...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::conversion::try_lexical_convert
functions.
boost::int128_type
and boost::uint128_type
conversions. Notify
user at compile time if the std::numeric_limits
are not specialized for 128bit types and boost::lexical_cast
can not make conversions.
boost::int128_type
and boost::uint128_type
types (requires GCC
4.7 or higher).
lexical_cast
function (was broken in 1.53.0).
lexical_cast(const CharType*
chars,
std::size_t count)
function overload.
boost::array<character_type, N>
and std::array<character_type, N>
conversions.
boost::bad_lexical_cast
exception is now
globaly visible and can be catched even if code is compiled with
-fvisibility=hidden.
boost::iterator_range<character_type*>
conversions.
boost::container::basic_string
conversions.
sizeof(double) < sizeof(long double)
).
std::numeric_limits
,
the current version now chooses a precision to match.
lexical_cast
now supports conversions from wchar_t
,
wchar_t *
,
and std::wstring
and to wchar_t
and std::wstring
.
lexical_cast
assumed that the conventional stream extractor operators were sufficient
for reading values. However, string I/O is asymmetric, with the result
that spaces play the role of I/O separators rather than string content.
The current version fixes this error for std::string
and, where supported, std::wstring
:
lexical_cast<std::string>("Hello, World")
succeeds instead of failing with a bad_lexical_cast
exception.
lexical_cast
allowed unsafe and meaningless conversions to pointers. The current
version now throws a bad_lexical_cast
for conversions to pointers: lexical_cast<char
*>("Goodbye,
World")
now
throws an exception instead of causing undefined behavior.