forked from boostorg/optional
Fixed extraction operator for empty optionals
[SVN r64206]
This commit is contained in:
@ -25,7 +25,7 @@
|
|||||||
# include <ostream>
|
# include <ostream>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <boost/assert.hpp>
|
||||||
#include "boost/optional/optional.hpp"
|
#include "boost/optional/optional.hpp"
|
||||||
#include "boost/utility/value_init.hpp"
|
#include "boost/utility/value_init.hpp"
|
||||||
|
|
||||||
@ -72,7 +72,12 @@ operator>>(std::basic_istream<CharType, CharTrait>& in, optional<T>& v)
|
|||||||
v = x ;
|
v = x ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
BOOST_ASSERT(d == '-');
|
||||||
|
d = in.get();
|
||||||
|
BOOST_ASSERT(d == '-');
|
||||||
v = optional<T>() ;
|
v = optional<T>() ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
|
Reference in New Issue
Block a user