Boost logo

Boost :

Subject: [boost] [numeric_cast] request for boost::numeric_downcast
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-11-06 07:14:25


Hi Fernando,

Amoung our utilities we have

   boost::polymorphic_cast
   boost::polymorphic_downcast

The latter only performs a check in debug builds, and can then be used
whenever the cast must succeed.

boost::numeric_cast has no such alternative. Therefore I wuold like to
see one. To keep in the naming convention from above, I think it could
be reasonable to call this

   boost::numeric_downcast

Furthermore, this should if possible be implemented in a seperate header
(which is included in the main header) that can be compiled without
exception-support. I think there are still platforms where they need
this functionality, but don't want to sue exceptions.

Any comments

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk