33#ifndef _GLIBCXX_UTILITY_H
34#define _GLIBCXX_UTILITY_H 1
37#pragma GCC system_header
40#if __cplusplus >= 201103L
45namespace std _GLIBCXX_VISIBILITY(default)
47_GLIBCXX_BEGIN_NAMESPACE_VERSION
50 template<
typename _Tp>
57 template<
typename _Tp,
58 typename _Up =
typename remove_cv<_Tp>::type,
61 using __enable_if_has_tuple_size = _Tp;
63 template<
typename _Tp>
64 struct tuple_size<const __enable_if_has_tuple_size<_Tp>>
67 template<
typename _Tp>
68 struct tuple_size<volatile __enable_if_has_tuple_size<_Tp>>
71 template<
typename _Tp>
72 struct tuple_size<const volatile __enable_if_has_tuple_size<_Tp>>
73 :
public tuple_size<_Tp> { };
75#if __cplusplus >= 201703L
76 template<
typename _Tp>
81 template<
size_t __i,
typename _Tp>
85 template<
size_t __i,
typename _Tp>
88 template<
size_t __i,
typename _Tp>
91 using type =
const __tuple_element_t<__i, _Tp>;
94 template<
size_t __i,
typename _Tp>
97 using type =
volatile __tuple_element_t<__i, _Tp>;
100 template<
size_t __i,
typename _Tp>
101 struct tuple_element<__i, const volatile _Tp>
103 using type =
const volatile __tuple_element_t<__i, _Tp>;
106#if __cplusplus >= 201402L
110 template<
typename _Tp,
typename... _Types>
112 __find_uniq_type_in_pack()
114 constexpr size_t __sz =
sizeof...(_Types);
115 constexpr bool __found[__sz] = { __is_same(_Tp, _Types) ... };
117 for (
size_t __i = 0; __i < __sz; ++__i)
135#ifdef __glibcxx_tuple_element_t
136 template<
size_t __i,
typename _Tp>
140#ifdef __glibcxx_integer_sequence
143 template<
typename _Tp, _Tp... _Idx>
146#if __cplusplus >= 202002L
147 static_assert(is_integral_v<_Tp>);
149 typedef _Tp value_type;
150 static constexpr size_t size()
noexcept {
return sizeof...(_Idx); }
154 template<
typename _Tp, _Tp _Num>
156#if __has_builtin(__make_integer_seq)
157 = __make_integer_seq<integer_sequence, _Tp, _Num>;
163 template<
size_t... _Idx>
167 template<
size_t _Num>
171 template<
typename... _Types>
175#if __cplusplus >= 201703L
178 explicit in_place_t() =
default;
181 inline constexpr in_place_t in_place{};
183 template<
typename _Tp>
struct in_place_type_t
185 explicit in_place_type_t() =
default;
188 template<
typename _Tp>
189 inline constexpr in_place_type_t<_Tp> in_place_type{};
191 template<
size_t _Idx>
struct in_place_index_t
193 explicit in_place_index_t() =
default;
196 template<
size_t _Idx>
197 inline constexpr in_place_index_t<_Idx> in_place_index{};
200 inline constexpr bool __is_in_place_type_v =
false;
202 template<
typename _Tp>
203 inline constexpr bool __is_in_place_type_v<in_place_type_t<_Tp>> =
true;
206 inline constexpr bool __is_in_place_index_v =
false;
209 inline constexpr bool __is_in_place_index_v<in_place_index_t<_Nm>> =
true;
213#if _GLIBCXX_USE_BUILTIN_TRAIT(__type_pack_element)
214 template<
size_t _Np,
typename... _Types>
216 {
using type = __type_pack_element<_Np, _Types...>; };
218 template<
size_t _Np,
typename... _Types>
222 template<
typename _Tp0,
typename... _Rest>
223 struct _Nth_type<0, _Tp0, _Rest...>
224 {
using type = _Tp0; };
226 template<
typename _Tp0,
typename _Tp1,
typename... _Rest>
227 struct _Nth_type<1, _Tp0, _Tp1, _Rest...>
228 {
using type = _Tp1; };
230 template<
typename _Tp0,
typename _Tp1,
typename _Tp2,
typename... _Rest>
231 struct _Nth_type<2, _Tp0, _Tp1, _Tp2, _Rest...>
232 {
using type = _Tp2; };
234 template<
size_t _Np,
typename _Tp0,
typename _Tp1,
typename _Tp2,
239 struct _Nth_type<_Np, _Tp0, _Tp1, _Tp2, _Rest...>
240 : _Nth_type<_Np - 3, _Rest...>
244 template<
typename _Tp0,
typename _Tp1,
typename _Tp2,
typename... _Rest>
245 struct _Nth_type<0, _Tp0, _Tp1, _Tp2, _Rest...>
246 {
using type = _Tp0; };
248 template<
typename _Tp0,
typename _Tp1,
typename _Tp2,
typename... _Rest>
249 struct _Nth_type<1, _Tp0, _Tp1, _Tp2, _Rest...>
250 {
using type = _Tp1; };
255 namespace ranges::__detail
257 template<
typename _Range>
258 inline constexpr bool __is_subrange =
false;
264 struct _Swallow_assign
267 constexpr const _Swallow_assign&
268 operator=(
const _Tp&)
const noexcept
289 _GLIBCXX17_INLINE
constexpr _Swallow_assign
ignore{};
291#if __glibcxx_flat_map || __glibcxx_flat_set
292 struct sorted_unique_t {
explicit sorted_unique_t() =
default; };
293 inline constexpr sorted_unique_t sorted_unique{};
295 struct sorted_equivalent_t {
explicit sorted_equivalent_t() =
default; };
296 inline constexpr sorted_equivalent_t sorted_equivalent{};
299#if __glibcxx_function_ref
303 explicit nontype_t() =
default;
307 constexpr nontype_t<__val> nontype{};
310 inline constexpr bool __is_nontype_v =
false;
313 inline constexpr bool __is_nontype_v<nontype_t<__val>> =
true;
316_GLIBCXX_END_NAMESPACE_VERSION
ISO C++ entities toplevel namespace is std.
make_integer_sequence< size_t, _Num > make_index_sequence
Alias template make_index_sequence.
integer_sequence< size_t, _Idx... > index_sequence
Alias template index_sequence.
__make_integer_seq< integer_sequence, _Tp, _Num > make_integer_sequence
Alias template make_integer_sequence.
constexpr _Swallow_assign ignore
make_index_sequence< sizeof...(_Types)> index_sequence_for
Alias template index_sequence_for.
Define a member typedef type only if a boolean constant is true.
Finds the size of a given tuple type.
Gives the type of the ith element of a given tuple type.
Class template integer_sequence.