29#ifndef _GLIBCXX_SYSTEM_ERROR
30#define _GLIBCXX_SYSTEM_ERROR 1
32#pragma GCC system_header
34#if __cplusplus < 201103L
42#if __cplusplus > 201703L
46namespace std _GLIBCXX_VISIBILITY(default)
48_GLIBCXX_BEGIN_NAMESPACE_VERSION
55 class error_condition;
59 template<
typename _Tp>
63 template<
typename _Tp>
70#if __cplusplus > 201402L
71 template <
typename _Tp>
72 inline constexpr bool is_error_code_enum_v =
73 is_error_code_enum<_Tp>::value;
74 template <
typename _Tp>
75 inline constexpr bool is_error_condition_enum_v =
76 is_error_condition_enum<_Tp>::value;
80_GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(_V2)
122#if _GLIBCXX_USE_CXX11_ABI
124 _GLIBCXX_DEFAULT_ABI_TAG
126 _M_message(
int)
const;
130 _GLIBCXX_DEFAULT_ABI_TAG
132 message(
int)
const = 0;
135 message(
int)
const = 0;
139 _M_message(
int)
const;
159 {
return this == &__other; }
162#if __cpp_lib_three_way_comparison
166 {
return std::compare_three_way()(
this, &__rhs); }
174 {
return this != &__other; }
181 [[__nodiscard__, __gnu__::__const__]]
182 const error_category&
186 [[__nodiscard__, __gnu__::__const__]]
192_GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
228 : _M_value(__v), _M_cat(&__cat) { }
230 template<
typename _ErrorCodeEnum,
typename =
typename
234 using __adl_only::make_error_code;
250 template<
typename _ErrorCodeEnum>
253 operator=(_ErrorCodeEnum __e)
noexcept
259 value() const noexcept {
return _M_value; }
271 _GLIBCXX_DEFAULT_ABI_TAG
278 explicit operator bool() const noexcept
279 {
return _M_value != 0; }
310#if __cpp_lib_three_way_comparison
312 inline strong_ordering
315 if (
auto __c = __lhs.category() <=> __rhs.category(); __c != 0)
317 return __lhs.value() <=> __rhs.value();
323 return (__lhs.category() < __rhs.category()
324 || (__lhs.category() == __rhs.category()
325 && __lhs.value() < __rhs.value()));
334 template<
typename _CharT,
typename _Traits>
360 : _M_value(__v), _M_cat(&__cat) { }
362 template<
typename _ErrorConditionEnum,
typename =
typename
366 using __adl_only::make_error_condition;
379 template<
typename _ErrorConditionEnum>
382 operator=(_ErrorConditionEnum __e)
noexcept
395 value() const noexcept {
return _M_value; }
403 _GLIBCXX_DEFAULT_ABI_TAG
410 explicit operator bool() const noexcept
411 {
return _M_value != 0; }
430 inline error_condition
447 return __lhs.category() == __rhs.category()
448 && __lhs.value() == __rhs.value();
463 return __lhs.category().equivalent(__lhs.value(), __rhs)
464 || __rhs.category().equivalent(__lhs, __rhs.value());
479 return __lhs.category() == __rhs.category()
480 && __lhs.value() == __rhs.value();
491#if __cpp_lib_three_way_comparison
493 inline strong_ordering
497 if (
auto __c = __lhs.category() <=> __rhs.category(); __c != 0)
499 return __lhs.value() <=> __rhs.value();
506 return (__lhs.category() < __rhs.category()
507 || (__lhs.category() == __rhs.category()
508 && __lhs.value() < __rhs.value()));
515 return (__rhs.category().equivalent(__rhs.value(), __lhs)
516 || __lhs.category().equivalent(__rhs, __lhs.value()));
521 operator!=(
const error_code& __lhs,
const error_code& __rhs)
noexcept
522 {
return !(__lhs == __rhs); }
526 operator!=(
const error_code& __lhs,
const error_condition& __rhs)
noexcept
527 {
return !(__lhs == __rhs); }
531 operator!=(
const error_condition& __lhs,
const error_code& __rhs)
noexcept
532 {
return !(__lhs == __rhs); }
536 operator!=(
const error_condition& __lhs,
537 const error_condition& __rhs)
noexcept
538 {
return !(__lhs == __rhs); }
572 _M_code(__v, __ecat) { }
576 _M_code(__v, __ecat) { }
578#if __cplusplus >= 201103L
586 code()
const noexcept {
return _M_code; }
589_GLIBCXX_END_NAMESPACE_VERSION
594namespace std _GLIBCXX_VISIBILITY(default)
596_GLIBCXX_BEGIN_NAMESPACE_VERSION
598#ifndef _GLIBCXX_COMPATIBILITY_CXX0X
604 :
public __hash_base<size_t, error_code>
607 operator()(
const error_code& __e)
const noexcept
609 const size_t __tmp = std::_Hash_impl::hash(__e.
value());
610 return std::_Hash_impl::__hash_combine(&__e.
category(), __tmp);
615#if __cplusplus >= 201703L
621 :
public __hash_base<size_t, error_condition>
626 const size_t __tmp = std::_Hash_impl::hash(__e.
value());
627 return std::_Hash_impl::__hash_combine(&__e.
category(), __tmp);
632_GLIBCXX_END_NAMESPACE_VERSION
bool operator==(const error_condition &__lhs, const error_condition &__rhs) noexcept
const error_category & generic_category() noexcept
Error category for errno error codes.
bool operator==(const error_code &__lhs, const error_condition &__rhs) noexcept
error_code make_error_code(errc __e) noexcept
bool operator==(const error_code &__lhs, const error_code &__rhs) noexcept
error_condition make_error_condition(errc __e) noexcept
const error_category & system_category() noexcept
Error category for other error codes defined by the OS.
error_condition make_error_condition(future_errc __errc) noexcept
Overload of make_error_condition for future_errc.
error_code make_error_code(future_errc __errc) noexcept
Overload of make_error_code for future_errc.
ISO C++ entities toplevel namespace is std.
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
Template class basic_ostream.
One of two subclasses of exception.
Primary class template hash.
virtual bool equivalent(int __i, const error_condition &__cond) const noexcept
Test whether cond corresponds to i for this category.
virtual bool equivalent(const error_code &__code, int __i) const noexcept
Test whether code corresponds to i for this category.
bool operator==(const error_category &__other) const noexcept
An error_category only compares equal to itself.
virtual const char * name() const noexcept=0
A string that identifies the error category.
virtual error_condition default_error_condition(int __i) const noexcept
Return an error_condition corresponding to i in this category.
const error_category & category() const noexcept
The error category that this error belongs to.
int value() const noexcept
The error value.
string message() const
The category's description of the value.
error_condition default_error_condition() const noexcept
An error_condition for this error's category and value.
const error_category & category() const noexcept
The error category that this error belongs to.
error_condition(int __v, const error_category &__cat) noexcept
Initialize with the specified value and category.
int value() const noexcept
The error value.
error_condition() noexcept
Initialize with a zero (no error) value and the generic category.
string message() const
The category's description of the value.
void assign(int __v, const error_category &__cat) noexcept
Set the value and category.
void clear() noexcept
Reset the value and category to the default-constructed state.
An exception type that includes an error_code value.
Define a member typedef type only if a boolean constant is true.
One of the comparison functors.