I have identical versions of boost on two different devices, yet the behavior is different for
lexical_cast<uint>("-1")
The documentation states that it should give me INT_MAX (2's complement rollover) but on one machine I get an exception throw while on the other one I get INT_MAX.
Apparently if you look at boost's code for
lexical_cast
the input is loaded and operated upon using code like thisinterpreter << arg; interpreter >> result
and in the>>
operatorIt uses
std::basic_istream
so different versions of libstdc++ will causelexical_cast
to behave differently on different machines.