|
Boost : |
Subject: Re: [boost] [optional_io] Request permission to merge simple fix to optional extraction operator
From: Daniel James (dnljms_at_[hidden])
Date: 2010-07-20 18:45:17
On 20 July 2010 20:24, Fernando Cacciola <fernando.cacciola_at_[hidden]> wrote:
> Hi James,
>
>> That doesn't look right to me. If the input isn't valid, you should
>> set the stream's fail bit, not assert.
>>
>
> Done:
>
> https://svn.boost.org/trac/boost/changeset/64208
There's no reason to rush this in. It's not clear if the beta is going
to be tomorrow, and if it is you can merge a fix like this afterwards.
I have some other reservations about the method though (not speaking
as a release manager here). You're checking for a space to see if
you're reading a value. But whitespace is usually skipped over in
streams as it separates values. I don't think there is a decent
solution to this. There's no clear generic way to interpret what is
and isn't an empty value (there could be for cases such as optional
numbers). It's too late now, but I just wouldn't have the method.
Streams aren't really appropriate for serialization/deserialization
round trips.
Daniel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk