Avoid instantiating the system category in error_code::operator std::error_code

This commit is contained in:
Peter Dimov committed 2021-09-24 15:24:45 +03:00
1 parent 4c201d26b2
commit 85c7d92302
2 files changed
+11 -1

No files matched your search

+9 -1
View File
@@ -504,8 +504,16 @@ public:
}
else if( lc_flags_ == 0 )
{
//return std::error_code();
// This condition must be the same as the one in error_category_impl.hpp
#if defined(__CYGWIN__) || defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER == 1800) || (defined(BOOST_GCC) && BOOST_GCC < 50000)
return std::error_code( 0, boost::system::system_category() );
#else
return std::error_code();
#endif
}
else
{