Try to fix g++ 4.x issue with generic_category

This commit is contained in:
Peter Dimov
2017-05-20 18:43:31 +03:00
parent b722a1ebda
commit 2d18f66800
2 changed files with 29 additions and 12 deletions
+12 -1
View File
@@ -251,7 +251,18 @@ namespace boost
{
if( *this == generic_category() )
{
return std::generic_category();
std::error_category const & st = std::generic_category();
int ev = ENOENT;
// if the standard generic category works, use it; else not
if( st.equivalent( ev, st.default_error_condition( ev ) ) )
{
// g++ 4.x with libstdc++ 5 installed fails, because the two
// generic categories, v1 and v2, get mixed up
return st;
}
}
return std_cat_;