Boost C++ Libraries: Ticket #9929: Bugfix: comparison involving different types https://svn.boost.org/trac10/ticket/9929 <p> difference_type does not necessary need to be of type int or size_t </p> <p> There is a pull request with a patch in: URL_OF_BOOST_RANGE_AT_GITHUB/pull/3 (sorry but for some reason links to pull requests are rejected...) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9929 Trac 1.4.3 Marshall Clow Sun, 20 Apr 2014 04:55:07 GMT <link>https://svn.boost.org/trac10/ticket/9929#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9929#comment:1</guid> <description> <p> But I do believe that it has to be a "signed integer type" </p> <p> See [iterator.requirements.general]/p1; the last sentence: </p> <blockquote> <p> For every iterator type X for which equality is defined, there is a corresponding signed integer type called the difference type of the iterator. </p> </blockquote> <p> See also [basic.fundamental]/p2, which says: </p> <blockquote> <p> There are five standard signed integer types : “signed char”, “short int”, “int”, “long int”, and “long long int”. </p> </blockquote> </description> <category>Ticket</category> </item> <item> <author>gonzalobg88@…</author> <pubDate>Sun, 20 Apr 2014 07:21:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9929#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9929#comment:2</guid> <description> <p> But does it say that user-defined signed integer types are not allowed? </p> <p> This is just debug code (inside a BOOST_ASSERT), and IMO the problem here is relying on implicit conversions. </p> <p> Why is this debug code comparing a difference_type which is typically std::ptrdiff_t with an int? Doesn't it make sense to construct a difference_type since it is going to be compared with one anyways? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Tue, 29 Apr 2014 00:03:44 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9929#comment:3 https://svn.boost.org/trac10/ticket/9929#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> Ticket