id summary reporter owner description type status milestone component version severity resolution keywords cc 2295 Inconsistent behavior when using 64 bit integer types Hrvoje Prgeša nasonov "1) Converting 64bit unsigned int to it's max value string representation and back results in exception (should be identity operation!): {{{ boost::uint64_t max = numeric_limits::max(); std::string s = lexical_cast(max); BOOST_CHECK_EQUAL(max, lexical_cast(s)); // crashes: std::bad_cast: bad lexical cast: source type value could not be interpreted as target }}} 2) Precise conditions when the conversion will fail are not specified in the documentation. Throwing of bad_lexical_cast is inconsistent: {{{ #define T short // add a digit to a min representation! s = lexical_cast(numeric_limits::min()) + ""0""; BOOST_CHECK_THROW(lexical_cast(s), boost::exception); // throws s = lexical_cast(numeric_limits::min()) + ""5""; BOOST_CHECK_THROW(lexical_cast(s), boost::exception); // throws #define T boost::int64_t s = lexical_cast(numeric_limits::min()) + ""0""; BOOST_CHECK_THROW(lexical_cast(s), boost::exception); // DOES NOT throw!?!? s = lexical_cast(numeric_limits::min()) + ""5""; BOOST_CHECK_THROW(lexical_cast(s), boost::exception); // throws }}} " Bugs closed To Be Determined lexical_cast Boost 1.36.0 Problem fixed lexical_cast 64 uint64_t int64_t