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