$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Samuel Krempp (krempp_at_[hidden])
Date: 2005-02-27 07:58:43
Is the documentation for numeric/conversion finalized yet ?
It seems that at least the code sample in
numeric/conversion/doc/numeric_cast.html
hasn't been kept up-to-date.
This sample
1/ includes inexistent header
2/ uses boost::bad_numeric_cast instead of
boost::numeric::bad_numeric_conversion
and same for the other exception classes
and most of all :
3/
// This works, because unsigned integral types cannot cause overflow.
unsigned char c=numeric_cast<unsigned char>(l);
But this line does raise an overflow exception (as it should, I guess).
I guess the comment was about unsigned types implementing
modulo-arithmetics, but in the end does numeric_cast check for unsigned
overflows, or not ??
-- Samuel