[optional_io] Request permission to merge simple fix to optional extraction operator

Hi All, It was brought to my attention that extracting an *empty* optional<> from a stream using the default provided operators (in optional_io.hpp), leaves one character behind, preventing any further extraction. This is clearly a bug so I can only guess that no one is using it (except for the user that reported it). The fix is quite trivial: https://svn.boost.org/trac/boost/changeset/64206 And I've updated the test accordingly to make sure it works. Can I marge the fix into the release branch? TIA --- Fernando Cacciola SciSoft Consulting, Founder http://www.scisoft-consulting.com

On 20 July 2010 19:28, Fernando Cacciola <fernando.cacciola@gmail.com> wrote:
This is clearly a bug so I can only guess that no one is using it (except for the user that reported it).
The fix is quite trivial:
https://svn.boost.org/trac/boost/changeset/64206
And I've updated the test accordingly to make sure it works.
Can I marge the fix into the release branch?
That doesn't look right to me. If the input isn't valid, you should set the stream's fail bit, not assert. Daniel

On 20/07/2010 03:47 p.m., Daniel James wrote:
On 20 July 2010 19:28, Fernando Cacciola<fernando.cacciola@gmail.com> wrote:
This is clearly a bug so I can only guess that no one is using it (except for the user that reported it).
The fix is quite trivial:
https://svn.boost.org/trac/boost/changeset/64206
And I've updated the test accordingly to make sure it works.
Can I marge the fix into the release branch?
That doesn't look right to me. If the input isn't valid, you should set the stream's fail bit, not assert.
So what doesn't look right is the assertion, rather than the important fix which is the line that reads in the additional character? I suppose you are right though, regarding what to do when the input is invalid. Best -- Fernando Cacciola SciSoft Consulting, Founder http://www.scisoft-consulting.com

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 -- Fernando Cacciola SciSoft Consulting, Founder http://www.scisoft-consulting.com

On 20 July 2010 20:24, Fernando Cacciola <fernando.cacciola@gmail.com> 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:
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
participants (2)
-
Daniel James
-
Fernando Cacciola