55 #ifndef _GLIBCXX_UTILITY 56 #define _GLIBCXX_UTILITY 1 58 #ifdef _GLIBCXX_SYSHDR 59 #pragma GCC system_header 73 #if __cplusplus >= 201103L 80 #if __cplusplus >= 202002L 84 #if __cplusplus > 202302L 88 #define __glibcxx_want_addressof_constexpr 89 #define __glibcxx_want_as_const 90 #define __glibcxx_want_constexpr_algorithms 91 #define __glibcxx_want_constexpr_utility 92 #define __glibcxx_want_exchange_function 93 #define __glibcxx_want_forward_like 94 #define __glibcxx_want_integer_comparison_functions 95 #define __glibcxx_want_integer_sequence 96 #define __glibcxx_want_ranges_zip 97 #define __glibcxx_want_to_underlying 98 #define __glibcxx_want_tuple_element_t 99 #define __glibcxx_want_tuples_by_type 100 #define __glibcxx_want_unreachable 101 #define __glibcxx_want_observable_checkpoint 102 #define __glibcxx_want_tuple_like 103 #define __glibcxx_want_constrained_equality 106 namespace std _GLIBCXX_VISIBILITY(default)
108 _GLIBCXX_BEGIN_NAMESPACE_VERSION
110 #ifdef __cpp_lib_exchange_function // C++ >= 14 112 template <
typename _Tp,
typename _Up = _Tp>
115 exchange(_Tp& __obj, _Up&& __new_val)
116 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
117 is_nothrow_assignable<_Tp&, _Up>>::value)
118 {
return std::__exchange(__obj, std::forward<_Up>(__new_val)); }
121 #ifdef __cpp_lib_as_const // C++ >= 17 122 template<
typename _Tp>
124 constexpr add_const_t<_Tp>&
125 as_const(_Tp& __t) noexcept
128 template<
typename _Tp>
129 void as_const(
const _Tp&&) =
delete;
132 #ifdef __cpp_lib_to_underlying // C++ >= 23 134 template<
typename _Tp>
135 [[nodiscard, __gnu__::__always_inline__]]
136 constexpr underlying_type_t<_Tp>
137 to_underlying(_Tp __value) noexcept
138 {
return static_cast<underlying_type_t<_Tp>
>(__value); }
141 #ifdef __cpp_lib_unreachable // C++ >= 23 154 [[noreturn,__gnu__::__always_inline__]]
158 #ifdef _GLIBCXX_DEBUG 159 std::__glibcxx_assert_fail(
nullptr, 0,
"std::unreachable()",
nullptr);
160 #elif defined _GLIBCXX_ASSERTIONS 163 __builtin_unreachable();
169 #ifdef __cpp_lib_observable_checkpoint // C++ >= 26 178 [[__gnu__::__always_inline__]]
180 observable_checkpoint() noexcept
182 return __builtin_observable_checkpoint();
186 _GLIBCXX_END_NAMESPACE_VERSION
ISO C++ entities toplevel namespace is std.