|
Boost : |
From: Fernando Cacciola (fernando_cacciola_at_[hidden])
Date: 2005-04-19 12:56:48
"Toon Knapen" <toon.knapen_at_[hidden]> escribió en el mensaje
news:4264B460.1060205_at_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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk