Try to work around g++-5 constexpr issue in failed_impl

This commit is contained in:
Peter Dimov
2018-09-22 20:05:31 +03:00
parent be972baaa3
commit e7c1079c4f

View File

@ -385,7 +385,33 @@ template<class T> struct enable_if<false, T>
// failed_impl
#if defined(BOOST_SYSTEM_HAS_CONSTEXPR)
#if !defined(BOOST_SYSTEM_HAS_CONSTEXPR)
inline bool failed_impl( int ev, error_category const & cat )
{
return cat.failed( ev );
}
#elif BOOST_WORKAROUND(BOOST_GCC, < 60000)
inline bool failed2_impl( int ev, error_category const & cat )
{
return cat.failed( ev );
}
BOOST_SYSTEM_CONSTEXPR inline bool failed_impl( int ev, error_category const & cat )
{
if( cat == system_category() || cat == generic_category() )
{
return ev != 0;
}
else
{
return failed2_impl( ev, cat );
}
}
#else
BOOST_SYSTEM_CONSTEXPR inline bool failed_impl( int ev, error_category const & cat )
{
@ -399,13 +425,6 @@ BOOST_SYSTEM_CONSTEXPR inline bool failed_impl( int ev, error_category const & c
}
}
#else
inline bool failed_impl( int ev, error_category const & cat )
{
return cat.failed( ev );
}
#endif
} // namespace detail