
19 Apr
2005
19 Apr
'05
5:56 p.m.
"Toon Knapen" <toon.knapen@fft.be> escribió en el mensaje news:4264B460.1060205@fft.be...
Currently following situation does not generate a bad_numeric_cast.
<test> unsigned int ui = std::numeric_limits< unsigned int >::max() ; int i = boost::numeric_cast< int >( ui ) ; </test>
Nevertheless 'i' is -1 instead of some very big number. To catch this kind of error, I propose to apply following patch to boost/cast.hpp (in attachment).
Take a look at the current replacement of _that_ numeric_cast<>: http://www.boost.org/libs/numeric/conversion/doc/numeric_cast.html Best Fernando Cacciola SciSoft