mirror of
https://github.com/boostorg/optional.git
synced 2025-07-29 20:17:21 +02:00
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
|
else
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(d == '-');
|
if ( d != '-')
|
||||||
|
in.setstate( ios::failbit );
|
||||||
|
|
||||||
d = in.get();
|
d = in.get();
|
||||||
BOOST_ASSERT(d == '-');
|
|
||||||
|
if ( d != '-')
|
||||||
|
in.setstate( ios::failbit );
|
||||||
|
|
||||||
v = optional<T>() ;
|
v = optional<T>() ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user