Hrvoje Prgeša | 6 Sep 18:00
Picon

Re: [lexical_cast] bad_lexical_cast behavior?

And another weirdness:

boost::uint64_t max = numeric_limits<boost::uint64_t>::max();
s = lexical_cast<string, boost::uint64_t>(max);
BOOST_CHECK_EQUAL(max, lexical_cast<boost::uint64_t>(s));
// crashes: std::bad_cast: bad lexical cast: source type value could not 
be interpreted as target

Converting 64bit unsigned int to it's max value string representation 
and back results in exception.

-- Hrvoje Prgeša

Gmane