Boost logo

Boost :

Subject: [boost] [lexical_cast] exception type for overflow
From: Jochen Wilhelmy (jochen.wilhelmy_at_[hidden])
Date: 2012-10-04 10:19:23


Hi!

i would expect that
lexical_cast<uint16_t>("65536")
and
numeric_cast<uint16_t>(lexical_cast<int>("65536"))
would throw the same exception boost::numeric::positive_overflow.
but lexical_cast throws a bad_lexical_cast.

is it possible to change lexical_cast so that it also throws
positive_overflow
if the error comes from the overflow and not from the lexical parsing?

-Jochen


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