Boost logo

Boost Users :

From: Paul Giaccone (paulg_at_[hidden])
Date: 2007-03-19 07:49:28


n.torrey.pines_at_[hidden] wrote:
> lexical_cast<int>("1e4") == 1 // because of the way streams work of course
>
> I think that in the interests of robustness, and unless a better
> solution can be found, lexical_cast<> should be secialized for some
> types.
>

Interesting... I had exactly the same issue in MEL the other day. The
obvious workaround is to cast the string to a float before casting it to
an int, but it would be nice if lexical_cast<int> recognised
floating-point numbers in scientific notation.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net