mirror of https://github.com/CGAL/cgal
fix istream for optional
Co-authored-by: Laurent Rineau <Laurent.Rineau@cgal.org>
This commit is contained in:
parent
5a962eb198
commit
b2be6dbbef
|
|
@ -281,7 +281,11 @@ public:
|
|||
Input_rep( std::optional<T>& tt) : t(tt) {}
|
||||
|
||||
//! perform the input, calls \c operator\>\> by default.
|
||||
std::istream& operator()( std::istream& is) const { return (is >> t.value()); }
|
||||
std::istream& operator()( std::istream& is) const {
|
||||
T v;
|
||||
if(is >> v) t = v;
|
||||
return is;
|
||||
}
|
||||
};
|
||||
|
||||
#if CGAL_FORCE_IFORMAT_DOUBLE || \
|
||||
|
|
|
|||
Loading…
Reference in New Issue