Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2002-08-09 17:41:04

Hi Andreas,

Some time ago I implemented a replacement for numeric_cast<> that correctly
handles some known problems (though this one seems compiler specific).

I was about to submit it for formal review but I run out of time and it
needed documentation.

Then Bjorn Karlsson worked with me on the documentation, but along the way,
as a result of our interchange, the replacement grown into a "numeric
conversion library", featuring highly-optimized code, support for
user-defined-types, customizable error handling and rounding mode control
for float to integer conversions.

The code is right now up and running (in real world applications), and the
documentation in nearly complete.

I was just waiting for MPL to be finally released since the implementation
uses some basic meta-programming, which is currently supplied by my own
overlapping meta programming tools, and which might not work well on other

If you need this right now, I can give you the code, test and docs
privately. If you have any problem with your compiler due to the
meta-programming stuff I can help you out. The test checks signed to
unsigned conversions specifically so you can verify if it works now.

The library comes with a black-box replacement for numeric_cast; so you
don't need to worry about its new features if you don't want to.

Fernando Cacciola
Sierra s.r.l.

Boost list run by bdawes at, gregod at, cpdaniel at, john at