Index: cast.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/cast.hpp,v retrieving revision 1.23 diff -u -r1.23 cast.hpp --- cast.hpp 4 Sep 2004 10:34:31 -0000 1.23 +++ cast.hpp 19 Apr 2005 07:21:50 -0000 @@ -294,7 +294,10 @@ // will work with every compiler I know of. template static inline bool check(X x, Y) - { return static_cast(static_cast(x)) != x; } + { return + ( static_cast(static_cast(x)) != x ) + || ( static_cast< Y >(x) < 0 ) ; + } }; #else // use #pragma hacks if available