Fixed behaviour in case of invalid input

[SVN r64208]
This commit is contained in:
Fernando Cacciola
2010-07-20 19:21:44 +00:00
parent c93e5a88c7
commit 8608ad1497

View File

@ -73,9 +73,14 @@ operator>>(std::basic_istream<CharType, CharTrait>& in, optional<T>& v)
}
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>() ;
}
}