forked from boostorg/system
Update documentation
This commit is contained in:
@@ -14,6 +14,7 @@ https://www.boost.org/LICENSE_1_0.txt
|
||||
* Added a `boost::source_location` parameter to `throw_exception_from_error`.
|
||||
* `result<T>::value` now automatically supplies `BOOST_CURRENT_LOCATION` to
|
||||
`throw_exception_from_error` via a default argument.
|
||||
* Added an `errc::make_error_code` overload taking a source location.
|
||||
|
||||
## Changes in Boost 1.78
|
||||
|
||||
|
@@ -185,9 +185,13 @@ namespace errc {
|
||||
template<> struct is_error_condition_enum<errc::errc_t>
|
||||
{ static const bool value = true; };
|
||||
|
||||
constexpr error_code make_error_code( errc::errc_t e ) noexcept;
|
||||
constexpr error_condition make_error_condition( errc::errc_t e ) noexcept;
|
||||
|
||||
constexpr error_code make_error_code( errc::errc_t e ) noexcept;
|
||||
|
||||
error_code make_error_code( errc::errc_t e,
|
||||
boost::source_location const * loc ) noexcept;
|
||||
|
||||
} // namespace system
|
||||
} // namespace boost
|
||||
```
|
||||
@@ -256,6 +260,38 @@ void my_api_function( boost::system::error_code& ec )
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
constexpr error_code make_error_code( errc::errc_t e,
|
||||
boost::source_location const * loc ) noexcept;
|
||||
```
|
||||
[none]
|
||||
* {blank}
|
||||
+
|
||||
Returns: :: `error_code( e, generic_category(), loc )`.
|
||||
|
||||
Same as the above overload, but takes a source location.
|
||||
* {blank}
|
||||
+
|
||||
```
|
||||
void my_api_function( boost::system::error_code& ec )
|
||||
{
|
||||
void* p = std::malloc( 16 );
|
||||
|
||||
if( p == 0 )
|
||||
{
|
||||
// return ENOMEM
|
||||
|
||||
BOOST_STATIC_CONSTEXPR boost::source_location loc =
|
||||
BOOST_CURRENT_LOCATION;
|
||||
|
||||
ec = make_error_code( boost::system::errc::out_of_memory, &loc );
|
||||
return;
|
||||
}
|
||||
|
||||
// use p
|
||||
}
|
||||
```
|
||||
|
||||
## <boost/system/{zwsp}error_category.hpp>
|
||||
|
||||
### error_category
|
||||
|
@@ -37,7 +37,7 @@ BOOST_SYSTEM_CONSTEXPR inline error_code make_error_code( errc_t e ) BOOST_NOEXC
|
||||
}
|
||||
|
||||
// explicit conversion:
|
||||
inline error_code make_error_code( errc_t e, boost::source_location const* loc ) BOOST_NOEXCEPT
|
||||
inline error_code make_error_code( errc_t e, boost::source_location const * loc ) BOOST_NOEXCEPT
|
||||
{
|
||||
return error_code( e, generic_category(), loc );
|
||||
}
|
||||
|
Reference in New Issue
Block a user