libstdc++
utility.h
Go to the documentation of this file.
1// Utilities used throughout the library -*- C++ -*-
2
3// Copyright (C) 2004-2026 Free Software Foundation, Inc.
4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 3, or (at your option)
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23// <http://www.gnu.org/licenses/>.
24
25/** @file include/bits/utility.h
26 * This is an internal header file, included by other library headers.
27 * Do not attempt to use it directly. @headername{utility}
28 *
29 * This file contains the parts of `<utility>` needed by other headers,
30 * so they don't need to include the whole of `<utility>`.
31 */
32
33#ifndef _GLIBCXX_UTILITY_H
34#define _GLIBCXX_UTILITY_H 1
35
36#ifdef _GLIBCXX_SYSHDR
37#pragma GCC system_header
38#endif
39
40#if __cplusplus >= 201103L
41
42#include <type_traits>
43#include <bits/move.h>
44
45namespace std _GLIBCXX_VISIBILITY(default)
46{
47_GLIBCXX_BEGIN_NAMESPACE_VERSION
48
49 /// Finds the size of a given tuple type.
50 template<typename _Tp>
51 struct tuple_size;
52
53 // _GLIBCXX_RESOLVE_LIB_DEFECTS
54 // 2313. tuple_size should always derive from integral_constant<size_t, N>
55 // 2770. tuple_size<const T> specialization is not SFINAE compatible
56
57 template<typename _Tp,
58 typename _Up = typename remove_cv<_Tp>::type,
59 typename = typename enable_if<is_same<_Tp, _Up>::value>::type,
61 using __enable_if_has_tuple_size = _Tp;
62
63 template<typename _Tp>
64 struct tuple_size<const __enable_if_has_tuple_size<_Tp>>
65 : public tuple_size<_Tp> { };
66
67 template<typename _Tp>
68 struct tuple_size<volatile __enable_if_has_tuple_size<_Tp>>
69 : public tuple_size<_Tp> { };
70
71 template<typename _Tp>
72 struct tuple_size<const volatile __enable_if_has_tuple_size<_Tp>>
73 : public tuple_size<_Tp> { };
74
75#if __cplusplus >= 201703L
76 template<typename _Tp>
77 inline constexpr size_t tuple_size_v = tuple_size<_Tp>::value;
78#endif
79
80 /// Gives the type of the ith element of a given tuple type.
81 template<size_t __i, typename _Tp>
83
84 // Duplicate of C++14's tuple_element_t for internal use in C++11 mode
85 template<size_t __i, typename _Tp>
86 using __tuple_element_t = typename tuple_element<__i, _Tp>::type;
87
88 template<size_t __i, typename _Tp>
89 struct tuple_element<__i, const _Tp>
90 {
91 using type = const __tuple_element_t<__i, _Tp>;
92 };
93
94 template<size_t __i, typename _Tp>
95 struct tuple_element<__i, volatile _Tp>
96 {
97 using type = volatile __tuple_element_t<__i, _Tp>;
98 };
99
100 template<size_t __i, typename _Tp>
101 struct tuple_element<__i, const volatile _Tp>
102 {
103 using type = const volatile __tuple_element_t<__i, _Tp>;
104 };
105
106#if __cplusplus >= 201402L
107
108 // Return the index of _Tp in _Types, if it occurs exactly once.
109 // Otherwise, return sizeof...(_Types).
110 template<typename _Tp, typename... _Types>
111 constexpr size_t
112 __find_uniq_type_in_pack()
113 {
114 constexpr size_t __sz = sizeof...(_Types);
115 constexpr bool __found[__sz] = { __is_same(_Tp, _Types) ... };
116 size_t __n = __sz;
117 for (size_t __i = 0; __i < __sz; ++__i)
118 {
119 if (__found[__i])
120 {
121 if (__n < __sz) // more than one _Tp found
122 return __sz;
123 __n = __i;
124 }
125 }
126 return __n;
127 }
128#endif // C++14
129
130// The standard says this macro and alias template should be in <tuple> but we
131// define them here, to be available in <array>, <utility> and <ranges> too.
132// _GLIBCXX_RESOLVE_LIB_DEFECTS
133// 3378. tuple_size_v/tuple_element_t should be available when
134// tuple_size/tuple_element are
135#ifdef __glibcxx_tuple_element_t // C++ >= 14
136 template<size_t __i, typename _Tp>
137 using tuple_element_t = typename tuple_element<__i, _Tp>::type;
138#endif
139
140#ifdef __glibcxx_constant_wrapper // C++ >= 26
141 template<typename _Tp>
142 struct _CwFixedValue
143 {
144 using __type = _Tp;
145
146 constexpr
147 _CwFixedValue(__type __v) noexcept
148 : _M_data(__v) { }
149
150 __type _M_data;
151 };
152
153 template<typename _Tp, size_t _Extent>
154 struct _CwFixedValue<_Tp[_Extent]>
155 {
156 using __type = _Tp[_Extent];
157
158 constexpr
159 _CwFixedValue(_Tp (&__arr)[_Extent]) noexcept
160 : _CwFixedValue(__arr, typename _Build_index_tuple<_Extent>::__type())
161 { }
162
163 template<size_t... _Indices>
164 constexpr
165 _CwFixedValue(_Tp (&__arr)[_Extent], _Index_tuple<_Indices...>) noexcept
166 : _M_data{__arr[_Indices]...}
167 { }
168
169 _Tp _M_data[_Extent];
170 };
171
172 template<typename _Tp, size_t _Extent>
173 _CwFixedValue(_Tp (&)[_Extent]) -> _CwFixedValue<_Tp[_Extent]>;
174
175 template<_CwFixedValue _Xv,
176 typename = typename decltype(_CwFixedValue(_Xv))::__type>
177 struct constant_wrapper;
178
179 template<typename _Tp>
180 concept _ConstExprParam = requires
181 {
182 typename constant_wrapper<_Tp::value>;
183 };
184
185 struct _CwOperators
186 {
187 template<_ConstExprParam _Tp>
188 friend constexpr auto
189 operator+(_Tp) noexcept -> constant_wrapper<(+_Tp::value)>
190 { return {}; }
191
192 template<_ConstExprParam _Tp>
193 friend constexpr auto
194 operator-(_Tp) noexcept -> constant_wrapper<(-_Tp::value)>
195 { return {}; }
196
197 template<_ConstExprParam _Tp>
198 friend constexpr auto
199 operator~(_Tp) noexcept -> constant_wrapper<(~_Tp::value)>
200 { return {}; }
201
202 template<_ConstExprParam _Tp>
203 friend constexpr auto
204 operator!(_Tp) noexcept -> constant_wrapper<(!_Tp::value)>
205 { return {}; }
206
207 template<_ConstExprParam _Tp>
208 friend constexpr auto
209 operator&(_Tp) noexcept -> constant_wrapper<(&_Tp::value)>
210 { return {}; }
211
212 template<_ConstExprParam _Tp>
213 friend constexpr auto
214 operator*(_Tp) noexcept -> constant_wrapper<(*_Tp::value)>
215 { return {}; }
216
217 template<_ConstExprParam _Left, _ConstExprParam _Right>
218 friend constexpr auto
219 operator+(_Left, _Right) noexcept
220 -> constant_wrapper<(_Left::value + _Right::value)>
221 { return {}; }
222
223 template<_ConstExprParam _Left, _ConstExprParam _Right>
224 friend constexpr auto
225 operator-(_Left, _Right) noexcept
226 -> constant_wrapper<(_Left::value - _Right::value)>
227 { return {}; }
228
229 template<_ConstExprParam _Left, _ConstExprParam _Right>
230 friend constexpr auto
231 operator*(_Left, _Right) noexcept
232 -> constant_wrapper<(_Left::value * _Right::value)>
233 { return {}; }
234
235 template<_ConstExprParam _Left, _ConstExprParam _Right>
236 friend constexpr auto
237 operator/(_Left, _Right) noexcept
238 -> constant_wrapper<(_Left::value / _Right::value)>
239 { return {}; }
240
241 template<_ConstExprParam _Left, _ConstExprParam _Right>
242 friend constexpr auto
243 operator%(_Left, _Right) noexcept
244 -> constant_wrapper<(_Left::value % _Right::value)>
245 { return {}; }
246
247 template<_ConstExprParam _Left, _ConstExprParam _Right>
248 friend constexpr auto
249 operator<<(_Left, _Right) noexcept
250 -> constant_wrapper<(_Left::value << _Right::value)>
251 { return {}; }
252
253 template<_ConstExprParam _Left, _ConstExprParam _Right>
254 friend constexpr auto
255 operator>>(_Left, _Right) noexcept
256 -> constant_wrapper<(_Left::value >> _Right::value)>
257 { return {}; }
258
259 template<_ConstExprParam _Left, _ConstExprParam _Right>
260 friend constexpr auto
261 operator&(_Left, _Right) noexcept
262 -> constant_wrapper<(_Left::value & _Right::value)>
263 { return {}; }
264
265 template<_ConstExprParam _Left, _ConstExprParam _Right>
266 friend constexpr auto
267 operator|(_Left, _Right) noexcept
268 -> constant_wrapper<(_Left::value | _Right::value)>
269 { return {}; }
270
271 template<_ConstExprParam _Left, _ConstExprParam _Right>
272 friend constexpr auto
273 operator^(_Left, _Right) noexcept
274 -> constant_wrapper<(_Left::value ^ _Right::value)>
275 { return {}; }
276
277 template<_ConstExprParam _Left, _ConstExprParam _Right>
278 requires (!is_constructible_v<bool, decltype(_Left::value)>
279 || !is_constructible_v<bool, decltype(_Right::value)>)
280 friend constexpr auto
281 operator&&(_Left, _Right) noexcept
282 -> constant_wrapper<(_Left::value && _Right::value)>
283 { return {}; }
284
285 template<_ConstExprParam _Left, _ConstExprParam _Right>
286 requires (!is_constructible_v<bool, decltype(_Left::value)>
287 || !is_constructible_v<bool, decltype(_Right::value)>)
288 friend constexpr auto
289 operator||(_Left, _Right) noexcept
290 -> constant_wrapper<(_Left::value || _Right::value)>
291 { return {}; }
292
293 template<_ConstExprParam _Left, _ConstExprParam _Right>
294 friend constexpr auto
295 operator<=>(_Left, _Right) noexcept
296 -> constant_wrapper<(_Left::value <=> _Right::value)>
297 { return {}; }
298
299 template<_ConstExprParam _Left, _ConstExprParam _Right>
300 friend constexpr auto
301 operator<(_Left, _Right) noexcept
302 -> constant_wrapper<(_Left::value < _Right::value)>
303 { return {}; }
304
305 template<_ConstExprParam _Left, _ConstExprParam _Right>
306 friend constexpr auto
307 operator<=(_Left, _Right) noexcept
308 -> constant_wrapper<(_Left::value <= _Right::value)>
309 { return {}; }
310
311 template<_ConstExprParam _Left, _ConstExprParam _Right>
312 friend constexpr auto
313 operator==(_Left, _Right) noexcept
314 -> constant_wrapper<(_Left::value == _Right::value)>
315 { return {}; }
316
317 template<_ConstExprParam _Left, _ConstExprParam _Right>
318 friend constexpr auto
319 operator!=(_Left, _Right) noexcept
320 -> constant_wrapper<(_Left::value != _Right::value)>
321 { return {}; }
322
323 template<_ConstExprParam _Left, _ConstExprParam _Right>
324 friend constexpr auto
325 operator>(_Left, _Right) noexcept
326 -> constant_wrapper<(_Left::value > _Right::value)>
327 { return {}; }
328
329 template<_ConstExprParam _Left, _ConstExprParam _Right>
330 friend constexpr auto
331 operator>=(_Left, _Right) noexcept
332 -> constant_wrapper<(_Left::value >= _Right::value)>
333 { return {}; }
334
335 template<_ConstExprParam _Left, _ConstExprParam _Right>
336 friend constexpr auto
337 operator,(_Left, _Right) noexcept = delete;
338
339 template<_ConstExprParam _Left, _ConstExprParam _Right>
340 friend constexpr auto
341 operator->*(_Left, _Right) noexcept
342 -> constant_wrapper<_Left::value->*(_Right::value)>
343 { return {}; }
344
345 template<_ConstExprParam _Tp, _ConstExprParam... _Args>
346 constexpr auto
347 operator()(this _Tp, _Args...) noexcept
348 requires
349 requires(_Args...) { constant_wrapper<_Tp::value(_Args::value...)>(); }
350 { return constant_wrapper<_Tp::value(_Args::value...)>{}; }
351
352 template<_ConstExprParam _Tp, _ConstExprParam... _Args>
353 constexpr auto
354 operator[](this _Tp, _Args...) noexcept
355 -> constant_wrapper<(_Tp::value[_Args::value...])>
356 { return {}; }
357
358 template<_ConstExprParam _Tp>
359 constexpr auto
360 operator++(this _Tp) noexcept
361 -> constant_wrapper<(++_Tp::value)>
362 { return {}; }
363
364 template<_ConstExprParam _Tp>
365 constexpr auto
366 operator++(this _Tp, int) noexcept
367 -> constant_wrapper<(_Tp::value++)>
368 { return {}; }
369
370 template<_ConstExprParam _Tp>
371 constexpr auto
372 operator--(this _Tp) noexcept
373 -> constant_wrapper<(--_Tp::value)>
374 { return {}; }
375
376 template<_ConstExprParam _Tp>
377 constexpr auto
378 operator--(this _Tp, int) noexcept
379 -> constant_wrapper<(_Tp::value--)>
380 { return {}; }
381
382 template<_ConstExprParam _Tp, _ConstExprParam _Right>
383 constexpr auto
384 operator+=(this _Tp, _Right) noexcept
385 -> constant_wrapper<(_Tp::value += _Right::value)>
386 { return {}; }
387
388 template<_ConstExprParam _Tp, _ConstExprParam _Right>
389 constexpr auto
390 operator-=(this _Tp, _Right) noexcept
391 -> constant_wrapper<(_Tp::value -= _Right::value)>
392 { return {}; }
393
394 template<_ConstExprParam _Tp, _ConstExprParam _Right>
395 constexpr auto
396 operator*=(this _Tp, _Right) noexcept
397 -> constant_wrapper<(_Tp::value *= _Right::value)>
398 { return {}; }
399
400 template<_ConstExprParam _Tp, _ConstExprParam _Right>
401 constexpr auto
402 operator/=(this _Tp, _Right) noexcept
403 -> constant_wrapper<(_Tp::value /= _Right::value)>
404 { return {}; }
405
406 template<_ConstExprParam _Tp, _ConstExprParam _Right>
407 constexpr auto
408 operator%=(this _Tp, _Right) noexcept
409 -> constant_wrapper<(_Tp::value %= _Right::value)>
410 { return {}; }
411
412 template<_ConstExprParam _Tp, _ConstExprParam _Right>
413 constexpr auto
414 operator&=(this _Tp, _Right) noexcept
415 -> constant_wrapper<(_Tp::value &= _Right::value)>
416 { return {}; }
417
418 template<_ConstExprParam _Tp, _ConstExprParam _Right>
419 constexpr auto
420 operator|=(this _Tp, _Right) noexcept
421 -> constant_wrapper<(_Tp::value |= _Right::value)>
422 { return {}; }
423
424 template<_ConstExprParam _Tp, _ConstExprParam _Right>
425 constexpr auto
426 operator^=(this _Tp, _Right) noexcept
427 -> constant_wrapper<(_Tp::value ^= _Right::value)>
428 { return {}; }
429
430 template<_ConstExprParam _Tp, _ConstExprParam _Right>
431 constexpr auto
432 operator<<=(this _Tp, _Right) noexcept
433 -> constant_wrapper<(_Tp::value <<= _Right::value)>
434 { return {}; }
435
436 template<_ConstExprParam _Tp, _ConstExprParam _Right>
437 constexpr auto
438 operator>>=(this _Tp, _Right) noexcept
439 -> constant_wrapper<(_Tp::value >>= _Right::value)>
440 { return {}; }
441 };
442
443 template<_CwFixedValue _Xv, typename>
444 struct constant_wrapper : _CwOperators
445 {
446 static constexpr const auto& value = _Xv._M_data;
447 using type = constant_wrapper;
448 using value_type = typename decltype(_Xv)::__type;
449
450 template<_ConstExprParam _Right>
451 constexpr auto
452 operator=(_Right) const noexcept
453 -> constant_wrapper<(value = _Right::value)>
454 { return {}; }
455
456 constexpr
457 operator decltype(value)() const noexcept
458 { return value; }
459 };
460
461 template<typename>
462 constexpr bool __is_constant_wrapper_v = false;
463
464 template<auto __cw, typename _Fn>
465 constexpr bool __is_constant_wrapper_v<constant_wrapper<__cw, _Fn>> = true;
466
467 template<_CwFixedValue _Tp>
468 constexpr auto cw = constant_wrapper<_Tp>{};
469#endif
470
471#ifdef __glibcxx_integer_sequence // C++ >= 14
472
473 /// Class template integer_sequence
474 template<typename _Tp, _Tp... _Idx>
476 {
477#if __cplusplus >= 202002L
478 static_assert(is_integral_v<_Tp>);
479#endif
480 typedef _Tp value_type;
481 static constexpr size_t size() noexcept { return sizeof...(_Idx); }
482 };
483
484 /// Alias template make_integer_sequence
485 template<typename _Tp, _Tp _Num>
487#if __has_builtin(__make_integer_seq)
488 = __make_integer_seq<integer_sequence, _Tp, _Num>;
489#else
490 = integer_sequence<_Tp, __integer_pack(_Num)...>;
491#endif
492
493 /// Alias template index_sequence
494 template<size_t... _Idx>
495 using index_sequence = integer_sequence<size_t, _Idx...>;
496
497 /// Alias template make_index_sequence
498 template<size_t _Num>
500
501 /// Alias template index_sequence_for
502 template<typename... _Types>
503 using index_sequence_for = make_index_sequence<sizeof...(_Types)>;
504#endif // __glibcxx_integer_sequence
505
506#if __cpp_structured_bindings >= 202411L
507#if __has_builtin(__integer_pack)
508 template <auto _Num, typename _Tp = decltype(_Num)>
509 inline constexpr _Tp
510 _IotaArray[_Num] = {__integer_pack(_Tp(_Num))...};
511#elif defined __glibcxx_integer_sequence
512 template <auto _Num, typename _Tp = decltype(_Num), typename = make_integer_sequence<_Tp, _Num>>
513 inline constexpr _Tp
514 _IotaArray[_Num];
515
516 template <auto _Num, typename _Tp, _Tp... _Is>
517 inline constexpr _Tp
518 _IotaArray<_Num, _Tp, integer_sequence<_Tp, _Is...>>[_Num] = {_Is...};
519#endif // __integer_pack
520#endif // __cpp_structured_bindings >= 202411L
521
522#if __cplusplus >= 201703L
523
524 struct in_place_t {
525 explicit in_place_t() = default;
526 };
527
528 inline constexpr in_place_t in_place{};
529
530 template<typename _Tp> struct in_place_type_t
531 {
532 explicit in_place_type_t() = default;
533 };
534
535 template<typename _Tp>
536 inline constexpr in_place_type_t<_Tp> in_place_type{};
537
538 template<size_t _Idx> struct in_place_index_t
539 {
540 explicit in_place_index_t() = default;
541 };
542
543 template<size_t _Idx>
544 inline constexpr in_place_index_t<_Idx> in_place_index{};
545
546 template<typename>
547 inline constexpr bool __is_in_place_type_v = false;
548
549 template<typename _Tp>
550 inline constexpr bool __is_in_place_type_v<in_place_type_t<_Tp>> = true;
551
552 template<typename>
553 inline constexpr bool __is_in_place_index_v = false;
554
555 template<size_t _Nm>
556 inline constexpr bool __is_in_place_index_v<in_place_index_t<_Nm>> = true;
557
558#endif // C++17
559
560#if _GLIBCXX_USE_BUILTIN_TRAIT(__type_pack_element)
561 template<size_t _Np, typename... _Types>
562 struct _Nth_type
563 { using type = __type_pack_element<_Np, _Types...>; };
564#else
565 template<size_t _Np, typename... _Types>
566 struct _Nth_type
567 { };
568
569 template<typename _Tp0, typename... _Rest>
570 struct _Nth_type<0, _Tp0, _Rest...>
571 { using type = _Tp0; };
572
573 template<typename _Tp0, typename _Tp1, typename... _Rest>
574 struct _Nth_type<1, _Tp0, _Tp1, _Rest...>
575 { using type = _Tp1; };
576
577 template<typename _Tp0, typename _Tp1, typename _Tp2, typename... _Rest>
578 struct _Nth_type<2, _Tp0, _Tp1, _Tp2, _Rest...>
579 { using type = _Tp2; };
580
581 template<size_t _Np, typename _Tp0, typename _Tp1, typename _Tp2,
582 typename... _Rest>
583#if __cpp_concepts
584 requires (_Np >= 3)
585#endif
586 struct _Nth_type<_Np, _Tp0, _Tp1, _Tp2, _Rest...>
587 : _Nth_type<_Np - 3, _Rest...>
588 { };
589
590#if ! __cpp_concepts // Need additional specializations to avoid ambiguities.
591 template<typename _Tp0, typename _Tp1, typename _Tp2, typename... _Rest>
592 struct _Nth_type<0, _Tp0, _Tp1, _Tp2, _Rest...>
593 { using type = _Tp0; };
594
595 template<typename _Tp0, typename _Tp1, typename _Tp2, typename... _Rest>
596 struct _Nth_type<1, _Tp0, _Tp1, _Tp2, _Rest...>
597 { using type = _Tp1; };
598#endif
599#endif
600
601#if __glibcxx_ranges
602 namespace ranges::__detail
603 {
604 template<typename _Range>
605 inline constexpr bool __is_subrange = false;
606 } // namespace __detail
607#endif
608
609 // A class (and instance) which can be used in 'tie' when an element
610 // of a tuple is not required.
611 struct _Swallow_assign
612 {
613 template<class _Tp>
614 constexpr const _Swallow_assign&
615 operator=(const _Tp&) const noexcept
616 { return *this; }
617 };
618
619 // _GLIBCXX_RESOLVE_LIB_DEFECTS
620 // 2773. Making std::ignore constexpr
621 /** Used with `std::tie` to ignore an element of a tuple
622 *
623 * When using `std::tie` to assign the elements of a tuple to variables,
624 * unwanted elements can be ignored by using `std::ignore`. For example:
625 *
626 * ```
627 * int x, y;
628 * std::tie(x, std::ignore, y) = std::make_tuple(1, 2, 3);
629 * ```
630 *
631 * This assignment will perform `x=1; std::ignore=2; y=3;` which results
632 * in the second element being ignored.
633 *
634 * @since C++11
635 */
636 _GLIBCXX17_INLINE constexpr _Swallow_assign ignore{};
637
638#if __glibcxx_flat_map || __glibcxx_flat_set // >= C++23
639 struct sorted_unique_t { explicit sorted_unique_t() = default; };
640 inline constexpr sorted_unique_t sorted_unique{};
641
642 struct sorted_equivalent_t { explicit sorted_equivalent_t() = default; };
643 inline constexpr sorted_equivalent_t sorted_equivalent{};
644#endif
645
646_GLIBCXX_END_NAMESPACE_VERSION
647} // namespace
648
649#endif // C++11
650#endif /* _GLIBCXX_UTILITY_H */
constexpr complex< _Tp > operator*(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x times y.
Definition complex:434
constexpr complex< _Tp > operator-(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x minus y.
Definition complex:404
constexpr complex< _Tp > operator+(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x plus y.
Definition complex:374
constexpr complex< _Tp > operator/(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x divided by y.
Definition complex:464
ISO C++ entities toplevel namespace is std.
make_integer_sequence< size_t, _Num > make_index_sequence
Alias template make_index_sequence.
Definition utility.h:497
integer_sequence< size_t, _Idx... > index_sequence
Alias template index_sequence.
Definition utility.h:493
__make_integer_seq< integer_sequence, _Tp, _Num > make_integer_sequence
Alias template make_integer_sequence.
Definition utility.h:486
constexpr _Swallow_assign ignore
Definition utility.h:634
constexpr bitset< _Nb > operator^(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
Definition bitset:1638
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
Definition bitset:1658
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
Definition bitset:1754
constexpr bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
Definition bitset:1628
make_index_sequence< sizeof...(_Types)> index_sequence_for
Alias template index_sequence_for.
Definition utility.h:501
constexpr bitset< _Nb > operator&(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
Definition bitset:1618
Define a member typedef type only if a boolean constant is true.
Definition type_traits:137
Finds the size of a given tuple type.
Definition utility.h:51
Gives the type of the ith element of a given tuple type.
Definition utility.h:82
Class template integer_sequence.
Definition utility.h:476