
15 Sep
2004
15 Sep
'04
7:30 p.m.
Vladimir Prus wrote:
Roland Richter wrote:
the reverse "input" operation
boost::lexical_cast< std::vector<int> >( "[ 7, 9 ]" ); // throws bad_lexical_cast
fails. This is because lexical_stream turns off white space skipping, and outfmt uses "[ ", ", ", and " ]" (with all those nifty spaces) as default formatting.
[...]
I've made a noise about this in the past. I strongly believe that current lexical_cast behaviour does not play nice with existing stream operators (which are commonly written to assume whitespace is skipped). There's no good reason for that, and lexical_cast should not use the "noskipws" flag.
Do you happen to know why it was introduced then in the first place? - Roland