mirror of
https://github.com/boostorg/system.git
synced 2025-07-30 20:47:14 +02:00
Revert operator bool() to its pre-failed value() != 0 meaning
This commit is contained in:
@ -626,7 +626,7 @@ constexpr explicit operator bool() const noexcept;
|
||||
[none]
|
||||
* {blank}
|
||||
+
|
||||
Returns: :: `failed()`.
|
||||
Returns: :: `val_ != 0`.
|
||||
|
||||
```
|
||||
operator std::error_code() const;
|
||||
@ -789,7 +789,7 @@ constexpr explicit operator bool() const noexcept;
|
||||
[none]
|
||||
* {blank}
|
||||
+
|
||||
Returns: :: `failed()`.
|
||||
Returns: :: `val_ != 0`.
|
||||
|
||||
```
|
||||
operator std::error_condition() const;
|
||||
|
@ -499,7 +499,7 @@ public:
|
||||
|
||||
BOOST_SYSTEM_CONSTEXPR explicit operator bool() const BOOST_NOEXCEPT // true if error
|
||||
{
|
||||
return failed_;
|
||||
return val_ != 0;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -509,12 +509,12 @@ public:
|
||||
|
||||
BOOST_SYSTEM_CONSTEXPR operator unspecified_bool_type() const BOOST_NOEXCEPT // true if error
|
||||
{
|
||||
return failed_? unspecified_bool_true: 0;
|
||||
return val_ != 0? unspecified_bool_true: 0;
|
||||
}
|
||||
|
||||
BOOST_SYSTEM_CONSTEXPR bool operator!() const BOOST_NOEXCEPT // true if no error
|
||||
{
|
||||
return !failed_;
|
||||
return val_ == 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -640,7 +640,7 @@ public:
|
||||
|
||||
BOOST_SYSTEM_CONSTEXPR explicit operator bool() const BOOST_NOEXCEPT // true if error
|
||||
{
|
||||
return failed_;
|
||||
return val_ != 0;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -650,12 +650,12 @@ public:
|
||||
|
||||
BOOST_SYSTEM_CONSTEXPR operator unspecified_bool_type() const BOOST_NOEXCEPT // true if error
|
||||
{
|
||||
return failed_? unspecified_bool_true: 0;
|
||||
return val_ != 0? unspecified_bool_true: 0;
|
||||
}
|
||||
|
||||
BOOST_SYSTEM_CONSTEXPR bool operator!() const BOOST_NOEXCEPT // true if no error
|
||||
{
|
||||
return !failed_;
|
||||
return val_ == 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -123,13 +123,13 @@ template<class Ec> void test()
|
||||
|
||||
{
|
||||
Ec ec( 0, http_category() );
|
||||
TEST_FAILED( ec );
|
||||
BOOST_TEST( ec.failed() );
|
||||
|
||||
ec.assign( 200, http_category() );
|
||||
TEST_NOT_FAILED( ec );
|
||||
BOOST_TEST( !ec.failed() );
|
||||
|
||||
ec = Ec( 404, http_category() );
|
||||
TEST_FAILED( ec );
|
||||
BOOST_TEST( ec.failed() );
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user