Compare commits

..

5 Commits

Author SHA1 Message Date
Peter Dimov 00b30343b9 Asciidoctor 2 fixes 2020-06-16 21:01:38 +03:00
Peter Dimov c91dbc8249 Update footer for Asciidoctor 2 2020-06-16 20:44:31 +03:00
Peter Dimov 00d85d8d37 Update revision history 2020-06-16 20:44:09 +03:00
Peter Dimov 5d3365717e Revert "Revert operator bool() to its pre-failed value() != 0 meaning"
This reverts commit 3164b387a5.
2020-06-16 20:24:23 +03:00
Peter Dimov 6942dc454b Fix unsupported use of BOOST_SYMBOL_VISIBLE on Sun C++ 2020-01-24 20:59:12 +02:00
6 changed files with 36 additions and 21 deletions
+1
View File
@@ -1,5 +1,6 @@
<style>
*:not(pre)>code { background: none; color: #600000; }
:not(pre):not([class^=L])>code { background: none; color: #600000; }
</style>
+5 -1
View File
@@ -8,9 +8,13 @@ http://www.boost.org/LICENSE_1_0.txt
////
[#changes]
# Release History
# Revision History
:idprefix:
## Changes in Boost 1.74
* `operator bool()` now returns `failed()` instead of `value() != 0`.
## Changes in Boost 1.69
* Boost.System is now header-only. A stub library is still built for
+16 -9
View File
@@ -568,7 +568,8 @@ constexpr void clear() noexcept;
[none]
* {blank}
+
Ensures: :: `val_ == 0`; `*cat_ == system_category()`.
Ensures: ::
`val_ == 0`; `*cat_ == system_category()`.
#### Observers
@@ -626,7 +627,7 @@ constexpr explicit operator bool() const noexcept;
[none]
* {blank}
+
Returns: :: `val_ != 0`.
Returns: :: `failed()`.
```
operator std::error_code() const;
@@ -634,7 +635,8 @@ operator std::error_code() const;
[none]
* {blank}
+
Returns: :: `std::error_code( val_, *cat_ )`.
Returns: ::
`std::error_code( val_, *cat_ )`.
### Class error_condition
@@ -711,7 +713,8 @@ template <class ErrorConditionEnum>
* {blank}
+
Ensures: :: `*this == make_error_condition( e )`.
Remarks: :: This constructor is only enabled when `is_error_condition_enum<ErrorConditionEnum>::value` is `true`.
Remarks: ::
This constructor is only enabled when `is_error_condition_enum<ErrorConditionEnum>::value` is `true`.
#### Modifiers
@@ -739,7 +742,8 @@ constexpr void clear() noexcept;
[none]
* {blank}
+
Ensures: :: `val_ == 0`; `*cat_ == generic_category()`.
Ensures: ::
`val_ == 0`; `*cat_ == generic_category()`.
#### Observers
@@ -789,7 +793,7 @@ constexpr explicit operator bool() const noexcept;
[none]
* {blank}
+
Returns: :: `val_ != 0`.
Returns: :: `failed()`.
```
operator std::error_condition() const;
@@ -797,7 +801,8 @@ operator std::error_condition() const;
[none]
* {blank}
+
Returns: :: `std::error_condition( val_, *cat_ )`.
Returns: ::
`std::error_condition( val_, *cat_ )`.
### Nonmember functions
@@ -882,7 +887,8 @@ std::size_t hash_value( const error_code & ec );
[none]
* {blank}
+
Returns: :: A hash value representing `ec`.
Returns: ::
A hash value representing `ec`.
## <boost/system/system_error.hpp>
@@ -941,7 +947,8 @@ system_error( int ev, const error_category & ecat );
[none]
* {blank}
+
Ensures: :: `code() == error_code( ev, ecat )`.
Ensures: ::
`code() == error_code( ev, ecat )`.
#### Observers
@@ -66,7 +66,9 @@ public:
virtual bool equivalent( const std::error_code & code, int condition ) const BOOST_NOEXCEPT;
};
#if !defined(__SUNPRO_CC) // trailing __global is not supported
inline std::error_category const & to_std_category( boost::system::error_category const & cat ) BOOST_SYMBOL_VISIBLE;
#endif
struct cat_ptr_less
{
+9 -8
View File
@@ -355,7 +355,10 @@ constexpr error_category const & generic_category() BOOST_NOEXCEPT
#else // #if defined(BOOST_SYSTEM_HAS_CONSTEXPR)
#if !defined(__SUNPRO_CC) // trailing __global is not supported
inline error_category const & system_category() BOOST_NOEXCEPT BOOST_SYMBOL_VISIBLE;
inline error_category const & generic_category() BOOST_NOEXCEPT BOOST_SYMBOL_VISIBLE;
#endif
inline error_category const & system_category() BOOST_NOEXCEPT
{
@@ -363,8 +366,6 @@ inline error_category const & system_category() BOOST_NOEXCEPT
return system_category_instance;
}
inline error_category const & generic_category() BOOST_NOEXCEPT BOOST_SYMBOL_VISIBLE;
inline error_category const & generic_category() BOOST_NOEXCEPT
{
static const detail::generic_error_category generic_category_instance;
@@ -514,7 +515,7 @@ public:
BOOST_SYSTEM_CONSTEXPR explicit operator bool() const BOOST_NOEXCEPT // true if error
{
return val_ != 0;
return failed_;
}
#else
@@ -524,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
@@ -655,7 +656,7 @@ public:
BOOST_SYSTEM_CONSTEXPR explicit operator bool() const BOOST_NOEXCEPT // true if error
{
return val_ != 0;
return failed_;
}
#else
@@ -665,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
+3 -3
View File
@@ -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 );
}
}