Skip to content

Commit

Permalink
fix istream for optional
Browse files Browse the repository at this point in the history
Co-authored-by: Laurent Rineau <[email protected]>
  • Loading branch information
sloriot and lrineau committed Aug 18, 2023
1 parent 5a962eb commit b2be6db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Stream_support/include/CGAL/IO/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ class Input_rep<std::optional<T>>
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 || \
Expand Down

0 comments on commit b2be6db

Please sign in to comment.