struct is_error_code_enum<future_errc> : public true_type { };
/// Points to a statically-allocated object derived from error_category.
+ [[__nodiscard__, __gnu__::__const__]]
const error_category&
future_category() noexcept;
/// Overload of make_error_code for `future_errc`.
+ [[__nodiscard__]]
inline error_code
make_error_code(future_errc __errc) noexcept
{ return error_code(static_cast<int>(__errc), future_category()); }
/// Overload of make_error_condition for `future_errc`.
+ [[__nodiscard__]]
inline error_condition
make_error_condition(future_errc __errc) noexcept
{ return error_condition(static_cast<int>(__errc), future_category()); }
equivalent(const error_code& __code, int __i) const noexcept;
/// An error_category only compares equal to itself.
+ [[__nodiscard__]]
bool
operator==(const error_category& __other) const noexcept
{ return this == &__other; }
/// Ordered comparison that defines a total order for error categories.
#if __cpp_lib_three_way_comparison
+ [[nodiscard]]
strong_ordering
operator<=>(const error_category& __rhs) const noexcept
{ return std::compare_three_way()(this, &__rhs); }
// DR 890.
/// Error category for `errno` error codes.
- _GLIBCXX_CONST const error_category& generic_category() noexcept;
+ [[__nodiscard__, __gnu__::__const__]]
+ const error_category&
+ generic_category() noexcept;
/// Error category for other error codes defined by the OS.
- _GLIBCXX_CONST const error_category& system_category() noexcept;
+ [[__nodiscard__, __gnu__::__const__]]
+ const error_category&
+ system_category() noexcept;
/// @}
{ return *this = make_error_code(__e); }
/// The error value.
+ [[__nodiscard__]]
int
value() const noexcept { return _M_value; }
/// The error category that this error belongs to.
+ [[__nodiscard__]]
const error_category&
category() const noexcept { return *_M_cat; }
{ return category().message(value()); }
/// Test whether `value()` is non-zero.
+ [[__nodiscard__]]
explicit operator bool() const noexcept
{ return _M_value != 0; }
* @relates error_code
* @since C++11
*/
+ [[__nodiscard__]]
inline error_code
make_error_code(errc __e) noexcept
{ return error_code(static_cast<int>(__e), generic_category()); }
* @since C++11
*/
#if __cpp_lib_three_way_comparison
+ [[nodiscard]]
inline strong_ordering
operator<=>(const error_code& __lhs, const error_code& __rhs) noexcept
{
// C++11 19.5.3.4 observers
/// The error value.
+ [[__nodiscard__]]
int
value() const noexcept { return _M_value; }
/// The error category that this error belongs to.
+ [[__nodiscard__]]
const error_category&
category() const noexcept { return *_M_cat; }
{ return category().message(value()); }
/// Test whether `value()` is non-zero.
+ [[__nodiscard__]]
explicit operator bool() const noexcept
{ return _M_value != 0; }
* @relates error_condition
* @since C++11
*/
+ [[__nodiscard__]]
inline error_condition
make_error_condition(errc __e) noexcept
{ return error_condition(static_cast<int>(__e), generic_category()); }
* @relates error_condition
* @since C++11
*/
+ [[__nodiscard__]]
inline bool
operator==(const error_code& __lhs, const error_code& __rhs) noexcept
{
* @relates error_condition
* @since C++11
*/
+ [[__nodiscard__]]
inline bool
operator==(const error_code& __lhs, const error_condition& __rhs) noexcept
{
* @relates error_condition
* @since C++11
*/
+ [[__nodiscard__]]
inline bool
operator==(const error_condition& __lhs,
const error_condition& __rhs) noexcept
* @since C++11
*/
#if __cpp_lib_three_way_comparison
+ [[nodiscard]]
inline strong_ordering
operator<=>(const error_condition& __lhs,
const error_condition& __rhs) noexcept