Boost C++ Libraries: Ticket #200: cast.hpp: greater_than_type_max<false, false> int/uint https://svn.boost.org/trac10/ticket/200 <pre class="wiki">Submitted by holger.joukl@lbbw.de File boost/boost/boost/cast.hpp: If the greater_than_type_max check method is called in this specialization: greater_than_type_max&lt;false, false&gt;.check(x, y) with unsigned int x and int y=INT_MAX, and x is bigger than INT_MAX, the check fails. Maybe it could be done this way (but I am C++ newbie, so I might overlook the subtleties): *** cast.hpp.orig Wed Sep 17 11:45:33 2003 --- cast.hpp Wed Sep 17 11:47:12 2003 *************** *** 295,301 **** // will work with every compiler I know of. template &lt;class X, class Y&gt; static inline bool check(X x, Y) ! { return static_cast&lt;X&gt;(static_cast&lt;Y&gt;(x)) != x; } }; #else // use #pragma hacks if available --- 295,301 ---- // will work with every compiler I know of. template &lt;class X, class Y&gt; static inline bool check(X x, Y) ! { return (static_cast&lt;X&gt;(static_cast&lt;Y&gt;(x)) != x) || (static_cast&lt;Y&gt;(x) &lt; 0); } }; #else // use #pragma hacks if available </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/200 Trac 1.4.3 david_abrahams Fri, 14 Oct 2005 18:40:29 GMT status, summary changed https://svn.boost.org/trac10/ticket/200#comment:1 https://svn.boost.org/trac10/ticket/200#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>summary</strong> <span class="trac-field-old">cast.hpp: greater_than_type_max&lt;false, false&gt; int/uint bug </span> → <span class="trac-field-new">cast.hpp: greater_than_type_max&lt;false, false&gt; int/uint</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=52572 That fix doesn't look right to me, and this code has long since been obsoleted and replaced by a better implementation for all but a few broken out-of-date compilers. I'm afraid it's not worth trying to make it better. </pre> Ticket