diff --git a/Stream_support/include/CGAL/IO/io.h b/Stream_support/include/CGAL/IO/io.h index 71308a423c6..0a0441857a2 100644 --- a/Stream_support/include/CGAL/IO/io.h +++ b/Stream_support/include/CGAL/IO/io.h @@ -248,7 +248,12 @@ Convenience function to construct an output representation (`Output_rep`) for ty Generic IO for type `T` with formatting tag. */ template -Output_rep oformat( const T& t, F format) { return Output_rep(t, format); } +Output_rep oformat( const T& t, F format) { + if constexpr (std::is_constructible_v, const T&, F>) + return Output_rep(t, format); + else + return Output_rep(t); +} } // namespace IO