diff --git a/Stream_support/include/CGAL/IO/io.h b/Stream_support/include/CGAL/IO/io.h index e57d4327bac..d9c2ea7f761 100644 --- a/Stream_support/include/CGAL/IO/io.h +++ b/Stream_support/include/CGAL/IO/io.h @@ -281,7 +281,11 @@ public: Input_rep( std::optional& 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 || \