|
Boost : |
From: Roland Richter (roland_at_[hidden])
Date: 2004-09-15 14:30:21
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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk