Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64208 - trunk/boost/optional
From: fernando.cacciola_at_[hidden]
Date: 2010-07-20 15:21:45


Author: fcacciola
Date: 2010-07-20 15:21:44 EDT (Tue, 20 Jul 2010)
New Revision: 64208
URL: http://svn.boost.org/trac/boost/changeset/64208

Log:
Fixed behaviour in case of invalid input
Text files modified:
   trunk/boost/optional/optional_io.hpp | 9 +++++++--
   1 files changed, 7 insertions(+), 2 deletions(-)

Modified: trunk/boost/optional/optional_io.hpp
==============================================================================
--- trunk/boost/optional/optional_io.hpp (original)
+++ trunk/boost/optional/optional_io.hpp 2010-07-20 15:21:44 EDT (Tue, 20 Jul 2010)
@@ -73,9 +73,14 @@
     }
     else
     {
- BOOST_ASSERT(d == '-');
+ if ( d != '-')
+ in.setstate( ios::failbit );
+
       d = in.get();
- BOOST_ASSERT(d == '-');
+
+ if ( d != '-')
+ in.setstate( ios::failbit );
+
       v = optional<T>() ;
     }
   }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk