From 877e8322d25bafb914a58588c769aeab33277cc1 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 22 Apr 2024 14:23:55 +0200 Subject: [PATCH] fix oformat --- Stream_support/include/CGAL/IO/io.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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