forked from boostorg/system
error_code wrapping std::error_code should never compare equal to error_code not wrapping std (because of hash_value.) Fixes #101.
This commit is contained in:
@@ -403,7 +403,12 @@ public:
|
|||||||
{
|
{
|
||||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||||
|
|
||||||
if( lhs.lc_flags_ == 1 && rhs.lc_flags_ == 1 )
|
bool s1 = lhs.lc_flags_ == 1;
|
||||||
|
bool s2 = rhs.lc_flags_ == 1;
|
||||||
|
|
||||||
|
if( s1 != s2 ) return false;
|
||||||
|
|
||||||
|
if( s1 && s2 )
|
||||||
{
|
{
|
||||||
std::error_code const& e1 = *reinterpret_cast<std::error_code const*>( lhs.d2_ );
|
std::error_code const& e1 = *reinterpret_cast<std::error_code const*>( lhs.d2_ );
|
||||||
std::error_code const& e2 = *reinterpret_cast<std::error_code const*>( rhs.d2_ );
|
std::error_code const& e2 = *reinterpret_cast<std::error_code const*>( rhs.d2_ );
|
||||||
@@ -421,7 +426,13 @@ public:
|
|||||||
{
|
{
|
||||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||||
|
|
||||||
if( lhs.lc_flags_ == 1 && rhs.lc_flags_ == 1 )
|
bool s1 = lhs.lc_flags_ == 1;
|
||||||
|
bool s2 = rhs.lc_flags_ == 1;
|
||||||
|
|
||||||
|
if( s1 < s2 ) return true;
|
||||||
|
if( s2 < s1 ) return false;
|
||||||
|
|
||||||
|
if( s1 && s2 )
|
||||||
{
|
{
|
||||||
std::error_code const& e1 = *reinterpret_cast<std::error_code const*>( lhs.d2_ );
|
std::error_code const& e1 = *reinterpret_cast<std::error_code const*>( lhs.d2_ );
|
||||||
std::error_code const& e2 = *reinterpret_cast<std::error_code const*>( rhs.d2_ );
|
std::error_code const& e2 = *reinterpret_cast<std::error_code const*>( rhs.d2_ );
|
||||||
|
Reference in New Issue
Block a user