diff --git a/lexical_cast.htm b/lexical_cast.htm
index efc7219..5457a33 100644
--- a/lexical_cast.htm
+++ b/lexical_cast.htm
@@ -245,6 +245,15 @@ Eliminate an overhead of std::locale
if your program runs in the "C
operator>>
conform to the standard. Read a good C++ book, study std::sentry
and ios_state_saver.
std::cout << boost::lexical_cast<unsigned int>("-1");
does not throw, but outputs 4294967295?boost::lexical_cast
has the behavior of stringstream
, which uses num_get
functions of std::locale
to convert numbers. If we look at the [22.2.2.1.2] of Programming languages — C++, we'll see, that num_get
uses the rules of scanf
for conversions. And in the C99 standard for unsigned input value minus sign is optional, so if a negative number is read, no errors will arise and the result will be the two's complement.
+