From 5e382efa84cae56e4fb96b77438182b3a0f4439d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 1 Oct 2021 15:51:13 +0300 Subject: [PATCH] Fix std::ostream failure on libstdc++ --- include/boost/core/type_name.hpp | 7 +++++++ test/type_name_test.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/boost/core/type_name.hpp b/include/boost/core/type_name.hpp index 93927fe..9a82dd3 100644 --- a/include/boost/core/type_name.hpp +++ b/include/boost/core/type_name.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW) # include #endif @@ -501,6 +502,12 @@ template class L, class Ch> std::string type_name( return tn + '<' + type_name( tn_identity() ) + '>'; } +// needed for libstdc++ +inline std::string type_name( tn_identity ) +{ + return "std::ostream"; +} + #if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW) inline std::string type_name( tn_identity ) diff --git a/test/type_name_test.cpp b/test/type_name_test.cpp index 61132cd..6ab08f5 100644 --- a/test/type_name_test.cpp +++ b/test/type_name_test.cpp @@ -193,7 +193,7 @@ int main() #endif - TEST(std::basic_ostream); + TEST(std::ostream); TEST(std::basic_ostream); #if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)