Move failed_impl into error_category.hpp

This commit is contained in:
Peter Dimov
2020-08-27 01:36:44 +03:00
parent 72ea1ef846
commit d50db54c44
4 changed files with 37 additions and 42 deletions
-35
View File
@@ -109,36 +109,6 @@ static const error_category & native_ecat BOOST_ATTRIBUTE_UNUSED = system_catego
#endif
namespace detail
{
// failed_impl
#if !defined(BOOST_SYSTEM_HAS_CONSTEXPR)
inline bool failed_impl( int ev, error_category const & cat )
{
return cat.failed( ev );
}
#else
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 cat.failed( ev );
}
}
#endif
} // namespace detail
// class error_condition
// error_conditions are portable, error_codes are system or library specific
@@ -602,11 +572,6 @@ inline char const * error_category::message( int ev, char * buffer, std::size_t
#endif
}
inline bool error_category::failed( int ev ) const BOOST_NOEXCEPT
{
return ev != 0;
}
} // namespace system
} // namespace boost