fix istream for optional

Co-authored-by: Laurent Rineau <Laurent.Rineau@cgal.org>
This commit is contained in:
Sebastien Loriot 2023-08-18 09:25:39 +02:00 committed by Sébastien Loriot
parent 5a962eb198
commit b2be6dbbef
1 changed files with 5 additions and 1 deletions

View File

@ -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 || \