forked from boostorg/optional
Fixed behaviour in case of invalid input
[SVN r64208]
This commit is contained in:
@ -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>() ;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user