Make error_category::op==, !=, < nonmembers (a non-literal class can't have constexpr members acc. to g++)

This commit is contained in:
Peter Dimov
2018-01-14 08:49:25 +02:00
parent de5a0cf3ca
commit fe55a4a963

View File

@ -310,15 +310,20 @@ namespace boost
BOOST_SYSTEM_NOEXCEPT;
inline virtual bool equivalent( const error_code & code,
int condition ) const BOOST_SYSTEM_NOEXCEPT;
BOOST_SYSTEM_CONSTEXPR bool operator==(const error_category & rhs) const BOOST_SYSTEM_NOEXCEPT
{ return this == &rhs; }
BOOST_SYSTEM_CONSTEXPR bool operator!=(const error_category & rhs) const BOOST_SYSTEM_NOEXCEPT
{ return this != &rhs; }
bool operator<( const error_category & rhs ) const BOOST_SYSTEM_NOEXCEPT
{ return std::less<const error_category*>()( this, &rhs ); }
};
BOOST_SYSTEM_CONSTEXPR inline bool operator==( const error_category & lhs,
const error_category & rhs ) BOOST_SYSTEM_NOEXCEPT
{ return &lhs == &rhs; }
BOOST_SYSTEM_CONSTEXPR inline bool operator!=( const error_category & lhs,
const error_category & rhs ) BOOST_SYSTEM_NOEXCEPT
{ return &lhs != &rhs; }
inline bool operator<( const error_category & lhs,
const error_category & rhs ) BOOST_SYSTEM_NOEXCEPT
{ return std::less<const error_category*>()( &lhs, &rhs ); }
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif