diff --git a/include/boost/system/detail/error_code.hpp b/include/boost/system/detail/error_code.hpp index 776bcf4..b934a8d 100644 --- a/include/boost/system/detail/error_code.hpp +++ b/include/boost/system/detail/error_code.hpp @@ -390,6 +390,32 @@ public: return !( lhs == rhs ); } + // + + template::value>::type> + inline friend bool operator==( error_code const & lhs, E rhs ) BOOST_NOEXCEPT + { + return lhs == make_error_code( rhs ); + } + + template::value>::type> + inline friend bool operator==( E lhs, error_code const & rhs ) BOOST_NOEXCEPT + { + return make_error_code( lhs ) == rhs; + } + + template::value>::type> + inline friend bool operator!=( error_code const & lhs, E rhs ) BOOST_NOEXCEPT + { + return !( lhs == rhs ); + } + + template::value>::type> + inline friend bool operator!=( E lhs, error_code const & rhs ) BOOST_NOEXCEPT + { + return !( lhs == rhs ); + } + #if defined(BOOST_SYSTEM_CLANG_6) inline friend bool operator==( error_code const & lhs, std::error_condition const & rhs ) BOOST_NOEXCEPT