From 60a20eeeb997b276b0507b920d91715528ddc3c9 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 19 Sep 2021 18:44:45 +0300 Subject: [PATCH] Retain old generic_category conversion behavior on g++ 4.8/4.9 --- include/boost/system/detail/error_category_impl.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/boost/system/detail/error_category_impl.hpp b/include/boost/system/detail/error_category_impl.hpp index b3ab74c..fa62142 100644 --- a/include/boost/system/detail/error_category_impl.hpp +++ b/include/boost/system/detail/error_category_impl.hpp @@ -104,7 +104,16 @@ inline boost::system::error_category::operator std::error_category const & () co { if( id_ == boost::system::detail::generic_category_id ) { +#if defined(BOOST_GCC) && BOOST_GCC < 50000 + + static const boost::system::detail::std_category generic_instance( this, 0x1F4D3 ); + return generic_instance; + +#else + return std::generic_category(); + +#endif } if( id_ == boost::system::detail::system_category_id )