
14 Jan
2005
14 Jan
'05
12:31 p.m.
Please, take a look at the new Boost Numeric Conversion Library:
http://www.boost.org/libs/numeric/conversion/doc/index.html
It replaces numeric_cast<> in cast.hpp (except for BCB and VC6 for which the new code has not been ported yet)
You are right. I didn't realize that this library was a replacement for numeric_cast.
Altough what you suggested is not supported by the new code, it would be easy to add a policy to select this saturating behaviour.. I used it in the past and I know that in certain contexts is very useful.
It often is when working with "signal"-kinds of data where performance or memory is more important than accuracy. Kristian Dupont