mirror of
https://github.com/boostorg/system.git
synced 2025-07-29 20:17:13 +02:00
Reorder constructor overloads
This commit is contained in:
@ -564,12 +564,12 @@ namespace boost {
|
||||
constexpr error_code() noexcept;
|
||||
constexpr error_code( int val, const error_category & cat ) noexcept;
|
||||
|
||||
template <class ErrorCodeEnum>
|
||||
constexpr error_code( ErrorCodeEnum e ) noexcept;
|
||||
|
||||
error_code( int val, const error_category & cat,
|
||||
boost::source_location const * loc ) noexcept;
|
||||
|
||||
template <class ErrorCodeEnum>
|
||||
constexpr error_code( ErrorCodeEnum e ) noexcept;
|
||||
|
||||
error_code( std::error_code const& ec ) noexcept;
|
||||
|
||||
// modifiers:
|
||||
@ -684,16 +684,6 @@ constexpr error_code( int val, const error_category & cat ) noexcept;
|
||||
+
|
||||
Ensures: :: `value() == val`; `category() == cat`; `!has_location()`.
|
||||
|
||||
```
|
||||
template <class ErrorCodeEnum>
|
||||
constexpr error_code( ErrorCodeEnum e ) noexcept;
|
||||
```
|
||||
[none]
|
||||
* {blank}
|
||||
+
|
||||
Ensures: :: `*this == make_error_code( e )`.
|
||||
Remarks: :: This constructor is only enabled when `is_error_code_enum<ErrorCodeEnum>::value` is `true`.
|
||||
|
||||
```
|
||||
error_code( int val, const error_category & cat,
|
||||
boost::source_location const * loc ) noexcept;
|
||||
@ -704,6 +694,16 @@ error_code( int val, const error_category & cat,
|
||||
Requires: :: `loc` points to a valid `boost::source_location` object with static storage duration.
|
||||
Ensures: :: `value() == val`; `category() == cat`; `has_location()`; `&location() == loc`.
|
||||
|
||||
```
|
||||
template <class ErrorCodeEnum>
|
||||
constexpr error_code( ErrorCodeEnum e ) noexcept;
|
||||
```
|
||||
[none]
|
||||
* {blank}
|
||||
+
|
||||
Ensures: :: `*this == make_error_code( e )`.
|
||||
Remarks: :: This constructor is only enabled when `is_error_code_enum<ErrorCodeEnum>::value` is `true`.
|
||||
|
||||
```
|
||||
error_code( std::error_code const & ec ) noexcept;
|
||||
```
|
||||
|
@ -98,12 +98,6 @@ public:
|
||||
d1_.cat_ = &cat;
|
||||
}
|
||||
|
||||
template<class ErrorCodeEnum> BOOST_SYSTEM_CONSTEXPR error_code( ErrorCodeEnum e,
|
||||
typename detail::enable_if<is_error_code_enum<ErrorCodeEnum>::value>::type* = 0 ) BOOST_NOEXCEPT
|
||||
{
|
||||
*this = make_error_code( e );
|
||||
}
|
||||
|
||||
error_code( int val, const error_category & cat, source_location const * loc ) BOOST_NOEXCEPT:
|
||||
d1_(), lc_flags_( ( loc? reinterpret_cast<boost::uintptr_t>( loc ): 2 ) | +detail::failed_impl( val, cat ) )
|
||||
{
|
||||
@ -111,6 +105,13 @@ public:
|
||||
d1_.cat_ = &cat;
|
||||
}
|
||||
|
||||
template<class ErrorCodeEnum> BOOST_SYSTEM_CONSTEXPR error_code( ErrorCodeEnum e,
|
||||
typename detail::enable_if<is_error_code_enum<ErrorCodeEnum>::value>::type* = 0 ) BOOST_NOEXCEPT:
|
||||
d1_(), lc_flags_( 0 )
|
||||
{
|
||||
*this = make_error_code( e );
|
||||
}
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
error_code( std::error_code const& ec ) BOOST_NOEXCEPT:
|
||||
|
Reference in New Issue
Block a user