57#define _STL_BVECTOR_H 1
59#ifndef _GLIBCXX_ALWAYS_INLINE
60#define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
63#if __cplusplus >= 201103L
68namespace std _GLIBCXX_VISIBILITY(default)
70_GLIBCXX_BEGIN_NAMESPACE_VERSION
72 typedef unsigned long _Bit_type;
73 enum { _S_word_bit = int(__CHAR_BIT__ *
sizeof(_Bit_type)) };
75 __attribute__((__nonnull__))
78 __fill_bvector_n(_Bit_type*,
size_t,
bool) _GLIBCXX_NOEXCEPT;
80_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
85 template<
typename,
typename>
friend class vector;
86 friend struct _Bit_iterator;
87 friend struct _Bit_const_iterator;
90 _Bit_reference() _GLIBCXX_NOEXCEPT : _M_p(0), _M_mask(0) { }
96 _Bit_reference(_Bit_type * __x, _Bit_type __y)
97 : _M_p(__x), _M_mask(__y) { }
100#if __cplusplus >= 201103L
101 _Bit_reference(
const _Bit_reference&) =
default;
104 _GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR
105 operator bool() const _GLIBCXX_NOEXCEPT
106 {
return !!(*_M_p & _M_mask); }
110 operator=(
bool __x) _GLIBCXX_NOEXCEPT
119#if __cplusplus > 202002L
120 constexpr const _Bit_reference&
121 operator=(
bool __x)
const noexcept
133 operator=(
const _Bit_reference& __x) _GLIBCXX_NOEXCEPT
134 {
return *
this = bool(__x); }
136 _GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR
138 operator==(
const _Bit_reference& __x)
const
139 {
return bool(*
this) == bool(__x); }
141 _GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR
143 operator<(
const _Bit_reference& __x)
const
144 {
return !bool(*
this) && bool(__x); }
148 flip() _GLIBCXX_NOEXCEPT
149 { *_M_p ^= _M_mask; }
151#if __cplusplus >= 201103L
154 swap(_Bit_reference __x, _Bit_reference __y)
noexcept
163 swap(_Bit_reference __x,
bool& __y)
noexcept
172 swap(
bool& __x, _Bit_reference __y)
noexcept
182#pragma GCC diagnostic push
183#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
184 struct _Bit_iterator_base
185 :
public std::iterator<std::random_access_iterator_tag, bool>
188 unsigned int _M_offset;
190 _GLIBCXX20_CONSTEXPR _GLIBCXX_ALWAYS_INLINE
192 _M_assume_normalized()
const
194#if __has_attribute(__assume__) && !defined(_GLIBCXX_CLANG)
195 unsigned int __ofst = _M_offset;
196 __attribute__ ((__assume__ (__ofst <
unsigned(_S_word_bit))));
201 _Bit_iterator_base(_Bit_type * __x,
unsigned int __y)
202 : _M_p(__x), _M_offset(__y) { }
208 _M_assume_normalized();
209 if (_M_offset++ ==
int(_S_word_bit) - 1)
220 _M_assume_normalized();
221 if (_M_offset-- == 0)
223 _M_offset = int(_S_word_bit) - 1;
230 _M_incr(ptrdiff_t __i)
232 _M_assume_normalized();
234 _M_p += __n / int(_S_word_bit);
235 __n = __n % int(_S_word_bit);
238 __n += int(_S_word_bit);
241 _M_offset =
static_cast<unsigned int>(__n);
245 friend _GLIBCXX20_CONSTEXPR
bool
246 operator==(
const _Bit_iterator_base& __x,
const _Bit_iterator_base& __y)
248 __x._M_assume_normalized();
249 __y._M_assume_normalized();
250 return __x._M_p == __y._M_p && __x._M_offset == __y._M_offset;
253#if __cpp_lib_three_way_comparison
255 friend constexpr strong_ordering
256 operator<=>(
const _Bit_iterator_base& __x,
const _Bit_iterator_base& __y)
259 __x._M_assume_normalized();
260 __y._M_assume_normalized();
261 if (
const auto __cmp = __x._M_p <=> __y._M_p; __cmp != 0)
263 return __x._M_offset <=> __y._M_offset;
268 operator<(
const _Bit_iterator_base& __x,
const _Bit_iterator_base& __y)
270 __x._M_assume_normalized();
271 __y._M_assume_normalized();
272 return __x._M_p < __y._M_p
273 || (__x._M_p == __y._M_p && __x._M_offset < __y._M_offset);
278 operator!=(
const _Bit_iterator_base& __x,
const _Bit_iterator_base& __y)
279 {
return !(__x == __y); }
283 operator>(
const _Bit_iterator_base& __x,
const _Bit_iterator_base& __y)
284 {
return __y < __x; }
288 operator<=(
const _Bit_iterator_base& __x,
const _Bit_iterator_base& __y)
289 {
return !(__y < __x); }
293 operator>=(
const _Bit_iterator_base& __x,
const _Bit_iterator_base& __y)
294 {
return !(__x < __y); }
297 friend _GLIBCXX20_CONSTEXPR ptrdiff_t
298 operator-(
const _Bit_iterator_base& __x,
const _Bit_iterator_base& __y)
300 __x._M_assume_normalized();
301 __y._M_assume_normalized();
302 return (
int(_S_word_bit) * (__x._M_p - __y._M_p)
303 + __x._M_offset - __y._M_offset);
306#pragma GCC diagnostic pop
308 struct _Bit_iterator :
public _Bit_iterator_base
310 typedef _Bit_reference reference;
311#if __cplusplus > 201703L
312 typedef void pointer;
314 typedef _Bit_reference* pointer;
316 typedef _Bit_iterator iterator;
319 _Bit_iterator() : _Bit_iterator_base(0, 0) { }
322 _Bit_iterator(_Bit_type * __x,
unsigned int __y)
323 : _Bit_iterator_base(__x, __y) { }
327 _M_const_cast()
const
330 _GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR
334 _M_assume_normalized();
335 return reference(_M_p, 1UL << _M_offset);
350 iterator __tmp = *
this;
367 iterator __tmp = *
this;
388 _GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR
391 {
return *(*
this + __i); }
394 friend _GLIBCXX20_CONSTEXPR iterator
397 iterator __tmp = __x;
403 friend _GLIBCXX20_CONSTEXPR iterator
405 {
return __x + __n; }
408 friend _GLIBCXX20_CONSTEXPR iterator
411 iterator __tmp = __x;
417 struct _Bit_const_iterator :
public _Bit_iterator_base
419 typedef bool reference;
420 typedef bool const_reference;
421#if __cplusplus > 201703L
422 typedef void pointer;
424 typedef const bool* pointer;
426 typedef _Bit_const_iterator const_iterator;
429 _Bit_const_iterator() : _Bit_iterator_base(0, 0) { }
432 _Bit_const_iterator(_Bit_type * __x,
unsigned int __y)
433 : _Bit_iterator_base(__x, __y) { }
436 _Bit_const_iterator(
const _Bit_iterator& __x)
437 : _Bit_iterator_base(__x._M_p, __x._M_offset) { }
441 _M_const_cast()
const
442 {
return _Bit_iterator(_M_p, _M_offset); }
444 _GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR
448 _M_assume_normalized();
449 return _Bit_reference(_M_p, 1UL << _M_offset);
464 const_iterator __tmp = *
this;
481 const_iterator __tmp = *
this;
502 _GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR
505 {
return *(*
this + __i); }
508 friend _GLIBCXX20_CONSTEXPR const_iterator
511 const_iterator __tmp = __x;
517 friend _GLIBCXX20_CONSTEXPR const_iterator
520 const_iterator __tmp = __x;
526 friend _GLIBCXX20_CONSTEXPR const_iterator
528 {
return __x + __n; }
531 template<
typename _Alloc>
535 rebind<_Bit_type>::other _Bit_alloc_type;
538 typedef typename _Bit_alloc_traits::pointer _Bit_pointer;
540 struct _Bvector_impl_data
542#if !_GLIBCXX_INLINE_VERSION
543 _Bit_iterator _M_start;
550 void operator=(_Bit_iterator __it) { _M_p = __it._M_p; }
553 _Bit_iterator _M_finish;
554 _Bit_pointer _M_end_of_storage;
557 _Bvector_impl_data() _GLIBCXX_NOEXCEPT
558 : _M_start(), _M_finish(), _M_end_of_storage()
561#if __cplusplus >= 201103L
562 _Bvector_impl_data(
const _Bvector_impl_data&) =
default;
565 operator=(
const _Bvector_impl_data&) =
default;
568 _Bvector_impl_data(_Bvector_impl_data&& __x) noexcept
569 : _Bvector_impl_data(__x)
574 _M_move_data(_Bvector_impl_data&& __x)
noexcept
583 _M_reset() _GLIBCXX_NOEXCEPT
584 { *
this = _Bvector_impl_data(); }
588 _M_swap_data(_Bvector_impl_data& __x) _GLIBCXX_NOEXCEPT
592 std::swap(*
this, __x);
597 :
public _Bit_alloc_type,
public _Bvector_impl_data
600 _Bvector_impl() _GLIBCXX_NOEXCEPT_IF(
601 is_nothrow_default_constructible<_Bit_alloc_type>::value)
602#if __cpp_concepts && __glibcxx_type_trait_variable_templates
603 requires is_default_constructible_v<_Bit_alloc_type>
609 _Bvector_impl(
const _Bit_alloc_type& __a) _GLIBCXX_NOEXCEPT
610 : _Bit_alloc_type(__a)
613#if __cplusplus >= 201103L
617 _Bvector_impl(_Bvector_impl&& __x) noexcept
622 _Bvector_impl(_Bit_alloc_type&& __a, _Bvector_impl&& __x) noexcept
629 _M_end_addr() const _GLIBCXX_NOEXCEPT
631 if (this->_M_end_of_storage)
638 typedef _Alloc allocator_type;
642 _M_get_Bit_allocator() _GLIBCXX_NOEXCEPT
643 {
return this->_M_impl; }
646 const _Bit_alloc_type&
647 _M_get_Bit_allocator() const _GLIBCXX_NOEXCEPT
648 {
return this->_M_impl; }
652 get_allocator() const _GLIBCXX_NOEXCEPT
653 {
return allocator_type(_M_get_Bit_allocator()); }
655#if __cplusplus >= 201103L
656 _Bvector_base() =
default;
662 _Bvector_base(
const allocator_type& __a)
663 : _M_impl(_Bit_alloc_type(__a)) { }
665#if __cplusplus >= 201103L
666 _Bvector_base(_Bvector_base&&) =
default;
669 _Bvector_base(_Bvector_base&& __x,
const allocator_type& __a) noexcept
670 : _M_impl(_Bit_alloc_type(__a),
std::move(__x._M_impl))
676 { this->_M_deallocate(); }
679 _Bvector_impl _M_impl;
683 _M_allocate(
size_t __n)
686#if __cpp_lib_is_constant_evaluated && __cpp_constexpr_dynamic_alloc
690 for (
size_t __i = 0; __i < __n; ++__i)
701 if (_M_impl._M_start._M_p)
703 const size_t __n = _M_impl._M_end_addr() - _M_impl._M_start._M_p;
705 _M_impl._M_end_of_storage - __n,
711#if __cplusplus >= 201103L
714 _M_move_data(_Bvector_base&& __x)
noexcept
715 { _M_impl._M_move_data(
std::move(__x._M_impl)); }
721 {
return (__n +
int(_S_word_bit) - 1) / int(_S_word_bit); }
745 template<
typename _Alloc>
746 class vector<bool, _Alloc> :
protected _Bvector_base<_Alloc>
752#if __cplusplus >= 201103L
754# if __cplusplus > 201703L
756 "std::vector must have the same value_type as its allocator");
761 typedef bool value_type;
762 typedef size_t size_type;
764 typedef _Bit_reference reference;
765 typedef bool const_reference;
766 typedef _Bit_reference* pointer;
767 typedef const bool* const_pointer;
768 typedef _Bit_iterator iterator;
769 typedef _Bit_const_iterator const_iterator;
772 typedef _Alloc allocator_type;
777 {
return _Base::get_allocator(); }
780 using _Base::_M_allocate;
781 using _Base::_M_deallocate;
782 using _Base::_S_nword;
783 using _Base::_M_get_Bit_allocator;
786#if __cplusplus >= 201103L
797#if __cplusplus >= 201103L
800 vector(size_type __n,
const allocator_type& __a = allocator_type())
805 vector(size_type __n,
const bool& __value,
806 const allocator_type& __a = allocator_type())
809 vector(size_type __n,
const bool& __value =
bool(),
810 const allocator_type& __a = allocator_type())
815 _M_initialize_value(__value);
820 : _Base(_Bit_alloc_traits::_S_select_on_copy(__x._M_get_Bit_allocator()))
823 _M_initialize(__x.
size());
827#if __cplusplus >= 201103L
844 _M_initialize(__x.
size());
853 noexcept(_Bit_alloc_traits::_S_always_equal())
862 _M_initialize(__x.
size());
868 const allocator_type& __a = allocator_type())
871 _M_initialize_range(
__l.begin(),
__l.end(),
876#if __cplusplus >= 201103L
881 const allocator_type& __a = allocator_type())
884 _M_initialize_range(__first, __last,
888 template<
typename _InputIterator>
890 const allocator_type& __a = allocator_type())
894 typedef typename std::__is_integer<_InputIterator>::__type
_Integral;
895 _M_initialize_dispatch(__first, __last,
_Integral());
899#if __glibcxx_containers_ranges
905 template<__detail::__container_compatible_range<
bool> _Rg>
910 if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>)
912 _M_initialize(size_type(ranges::distance(
__rg)));
917 auto __first = ranges::begin(
__rg);
918 const auto __last = ranges::end(
__rg);
919 for (; __first != __last; ++__first)
920 emplace_back(*__first);
934#if __cplusplus >= 201103L
935 if (_Bit_alloc_traits::_S_propagate_on_copy_assign())
937 if (this->_M_get_Bit_allocator() != __x._M_get_Bit_allocator())
939 this->_M_deallocate();
941 __x._M_get_Bit_allocator());
942 _M_initialize(__x.
size());
946 __x._M_get_Bit_allocator());
951 this->_M_deallocate();
952 _M_initialize(__x.
size());
954 this->_M_impl._M_finish = _M_copy_aligned(__x.
begin(), __x.
end(),
959#if __cplusplus >= 201103L
964 if (_Bit_alloc_traits::_S_propagate_on_move_assign()
965 || this->_M_get_Bit_allocator() == __x._M_get_Bit_allocator())
967 this->_M_deallocate();
970 __x._M_get_Bit_allocator());
976 this->_M_deallocate();
977 _M_initialize(__x.
size());
979 this->_M_impl._M_finish = _M_copy_aligned(__x.
begin(), __x.
end(),
1001 assign(size_type __n,
const bool& __x)
1002 { _M_fill_assign(__n, __x); }
1004#if __cplusplus >= 201103L
1012 template<
typename _InputIterator>
1017 typedef typename std::__is_integer<_InputIterator>::__type
_Integral;
1018 _M_assign_dispatch(__first, __last,
_Integral());
1022#if __cplusplus >= 201103L
1029#if __glibcxx_containers_ranges
1036 template<__detail::__container_compatible_range<
bool> _Rg>
1041 if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>)
1043 if (
auto __n = size_type(ranges::distance(
__rg)))
1046 this->_M_impl._M_finish
1055 auto __first = ranges::begin(
__rg);
1056 const auto __last = ranges::end(
__rg);
1057 for (; __first != __last; ++__first)
1058 emplace_back(*__first);
1066 {
return iterator(this->_M_impl._M_start._M_p, 0); }
1071 {
return const_iterator(this->_M_impl._M_start._M_p, 0); }
1076 {
return this->_M_impl._M_finish; }
1081 {
return this->_M_impl._M_finish; }
1103#if __cplusplus >= 201103L
1107 {
return const_iterator(this->_M_impl._M_start._M_p, 0); }
1111 cend()
const noexcept
1112 {
return this->_M_impl._M_finish; }
1121 crend()
const noexcept
1128 {
return size_type(
end() -
begin()); }
1135 __gnu_cxx::__numeric_traits<difference_type>::__max
1136 - int(_S_word_bit) + 1;
1138 = _Bit_alloc_traits::max_size(_M_get_Bit_allocator());
1146 {
return size_type(const_iterator(this->_M_impl._M_end_addr(), 0)
1158 __glibcxx_requires_subscript(__n);
1159 return _Bit_reference (this->_M_impl._M_start._M_p
1160 + __n /
int(_S_word_bit),
1161 1UL << __n %
int(_S_word_bit));
1168 __glibcxx_requires_subscript(__n);
1169 return _Bit_reference (this->_M_impl._M_start._M_p
1170 + __n /
int(_S_word_bit),
1171 1UL << __n %
int(_S_word_bit));
1179 if (__n >= this->
size())
1180 __throw_out_of_range_fmt(__N(
"vector<bool>::_M_range_check: __n "
1181 "(which is %zu) >= this->size() "
1192 return (*
this)[__n];
1197 at(size_type __n)
const
1200 return (*
this)[__n];
1208 __throw_length_error(__N(
"vector::reserve"));
1217 __glibcxx_requires_nonempty();
1225 __glibcxx_requires_nonempty();
1233 __glibcxx_requires_nonempty();
1234 return *(
end() - 1);
1241 __glibcxx_requires_nonempty();
1242 return *(
end() - 1);
1249 if (this->_M_impl._M_finish._M_p !=
this->_M_impl._M_end_addr())
1250 *this->_M_impl._M_finish++ = __x;
1252 _M_insert_aux(
end(), __x);
1259#if __cplusplus >= 201103L
1260 __glibcxx_assert(_Bit_alloc_traits::propagate_on_container_swap::value
1261 || _M_get_Bit_allocator() == __x._M_get_Bit_allocator());
1263 this->_M_impl._M_swap_data(__x._M_impl);
1264 _Bit_alloc_traits::_S_on_swap(_M_get_Bit_allocator(),
1265 __x._M_get_Bit_allocator());
1280#if __cplusplus >= 201103L
1287 if (this->_M_impl._M_finish._M_p !=
this->_M_impl._M_end_addr()
1289 *this->_M_impl._M_finish++ = __x;
1291 _M_insert_aux(
__position._M_const_cast(), __x);
1292 return begin() + __n;
1295#if _GLIBCXX_USE_DEPRECATED
1296 _GLIBCXX_DEPRECATED_SUGGEST(
"insert(position, false)")
1299 {
return this->
insert(__position._M_const_cast(),
false); }
1302#if __cplusplus >= 201103L
1314 return begin() + __offset;
1317 template<
typename _InputIterator>
1323 typedef typename std::__is_integer<_InputIterator>::__type
_Integral;
1328#if __cplusplus >= 201103L
1334 _M_fill_insert(
__position._M_const_cast(), __n, __x);
1335 return begin() + __offset;
1343#if __cplusplus >= 201103L
1350#if __glibcxx_containers_ranges
1359 template<__detail::__container_compatible_range<
bool> _Rg>
1363 if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>)
1365 if (
auto __n = size_type(ranges::distance(
__rg)))
1369 std::copy_backward(
__pos._M_const_cast(),
end(),
1370 this->_M_impl._M_finish
1372 ranges::copy(
__rg,
__pos._M_const_cast());
1374 return __pos._M_const_cast();
1378 const size_type
__len =
1379 _M_check_len(__n,
"vector<bool>::insert_range");
1380 const iterator __begin =
begin(), __end =
end();
1383 iterator __i = _M_copy_aligned(__begin,
1384 __pos._M_const_cast(),
1386 iterator __j = ranges::copy(
__rg, __i).out;
1389 this->_M_deallocate();
1390 this->_M_impl._M_end_of_storage = __q + _S_nword(
__len);
1391 this->_M_impl._M_start =
__start;
1392 this->_M_impl._M_finish =
__finish;
1397 return __pos._M_const_cast();
1408 template<__detail::__container_compatible_range<
bool> _Rg>
1415 if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>)
1417 const auto __n = size_type(ranges::distance(
__rg));
1428 this->_M_impl._M_finish
1434 __tmp.reserve(_M_check_len(__n,
"vector::append_range"));
1435 __tmp._M_impl._M_finish
1437 __tmp._M_impl._M_finish
1443 auto __first = ranges::begin(
__rg);
1444 const auto __last = ranges::end(
__rg);
1448 __first != __last &&
__free > 0;
1450 emplace_back(*__first);
1452 if (__first == __last)
1466 { --this->_M_impl._M_finish; }
1470#if __cplusplus >= 201103L
1475 {
return _M_erase(
__position._M_const_cast()); }
1479#if __cplusplus >= 201103L
1480 erase(const_iterator __first, const_iterator __last)
1482 erase(iterator __first, iterator __last)
1484 {
return _M_erase(__first._M_const_cast(), __last._M_const_cast()); }
1496#if __cplusplus >= 201103L
1500 { _M_shrink_to_fit(); }
1507 _Bit_type *
const __end = this->_M_impl._M_end_addr();
1508 for (_Bit_type * __p = this->_M_impl._M_start._M_p; __p != __end; ++__p)
1515 { _M_erase_at_end(
begin()); }
1517#if __cplusplus >= 201103L
1518 template<
typename...
_Args>
1519#if __cplusplus > 201402L
1528#if __cplusplus > 201402L
1533 template<
typename...
_Args>
1544 _M_copy_aligned(const_iterator __first, const_iterator __last,
1547 _Bit_type* __q = std::copy(__first._M_p, __last._M_p, __result._M_p);
1548 return std::copy(const_iterator(__last._M_p, 0), __last,
1554 _M_initialize(size_type __n)
1559 this->_M_impl._M_end_of_storage = __q + _S_nword(__n);
1561 this->_M_impl._M_start =
__start;
1570 if (_Bit_type* __p = this->_M_impl._M_start._M_p)
1571 __fill_bvector_n(__p, this->_M_impl._M_end_addr() - __p, __x);
1576 _M_reallocate(size_type __n);
1578#if __cplusplus >= 201103L
1584#if __cplusplus < 201103L
1587 template<
typename _Integer>
1591 _M_initialize(
static_cast<size_type
>(__n));
1592 _M_initialize_value(__x);
1595 template<
typename _InputIterator>
1599 { _M_initialize_range(__first, __last,
1603 template<
typename _InputIterator>
1609 for (; __first != __last; ++__first)
1613 template<
typename _ForwardIterator>
1621 std::copy(__first, __last,
begin());
1624#if __cplusplus < 201103L
1627 template<
typename _Integer>
1630 { _M_fill_assign(__n, __val); }
1632 template<
class _InputIterator>
1641 _M_fill_assign(
size_t __n,
bool __x)
1645 _M_initialize_value(__x);
1650 _M_erase_at_end(
begin() + __n);
1651 _M_initialize_value(__x);
1655 template<
typename _InputIterator>
1664 if (__first == __last)
1665 _M_erase_at_end(
__cur);
1670 template<
typename _ForwardIterator>
1678 _M_erase_at_end(std::copy(__first, __last,
begin()));
1688#if __cplusplus < 201103L
1691 template<
typename _Integer>
1695 { _M_fill_insert(
__pos, __n, __x); }
1697 template<
typename _InputIterator>
1699 _M_insert_dispatch(iterator
__pos,
1702 { _M_insert_range(
__pos, __first, __last,
1708 _M_fill_insert(iterator
__position, size_type __n,
bool __x);
1710 template<
typename _InputIterator>
1716 for (; __first != __last; ++__first)
1723 template<
typename _ForwardIterator>
1731 _M_insert_aux(iterator
__position,
bool __x);
1735 _M_check_len(size_type __n,
const char*
__s)
const
1738 __throw_length_error(__N(
__s));
1746 _M_erase_at_end(iterator
__pos)
1747 { this->_M_impl._M_finish =
__pos; }
1751 _M_erase(iterator
__pos);
1755 _M_erase(iterator __first, iterator __last);
1763#if __cplusplus >= 201103L
1764 void data() =
delete;
1770_GLIBCXX_END_NAMESPACE_CONTAINER
1775 __fill_bvector(_Bit_type*
__v,
unsigned int __first,
unsigned int __last,
1778 const _Bit_type
__fmask = ~0
ul << __first;
1779 const _Bit_type
__lmask = ~0
ul >> (_S_word_bit - __last);
1789 __attribute__((__nonnull__))
1790 _GLIBCXX20_CONSTEXPR
1792 __fill_bvector_n(_Bit_type* __p,
size_t __n,
bool __x) _GLIBCXX_NOEXCEPT
1794#if __cpp_lib_is_constant_evaluated
1797 for (
size_t __i = 0; __i < __n; ++__i)
1798 __p[__i] = __x ? ~0ul : 0ul;
1802 __builtin_memset(__p, __x ? ~0 : 0, __n * sizeof(_Bit_type));
1806 _GLIBCXX20_CONSTEXPR
1808 __fill_a1(_GLIBCXX_STD_C::_Bit_iterator __first,
1809 _GLIBCXX_STD_C::_Bit_iterator __last,
const bool& __x)
1811 if (__first._M_p != __last._M_p)
1813 _Bit_type* __first_p = __first._M_p;
1814 if (__first._M_offset != 0)
1815 __fill_bvector(__first_p++, __first._M_offset, _S_word_bit, __x);
1817 __fill_bvector_n(__first_p, __last._M_p - __first_p, __x);
1819 if (__last._M_offset != 0)
1820 __fill_bvector(__last._M_p, 0, __last._M_offset, __x);
1822 else if (__first._M_offset != __last._M_offset)
1823 __fill_bvector(__first._M_p, __first._M_offset, __last._M_offset, __x);
1826#if __cplusplus >= 201103L
1829 template<
typename _Alloc>
1831 :
public __hash_base<size_t, _GLIBCXX_STD_C::vector<bool, _Alloc>>
1834 operator()(
const _GLIBCXX_STD_C::vector<bool, _Alloc>&)
const noexcept;
1838_GLIBCXX_END_NAMESPACE_VERSION
constexpr bool operator<=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr bool operator>=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr bool operator<(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr bool operator>(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr complex< _Tp > operator*(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x times y.
constexpr complex< _Tp > operator-(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x minus y.
constexpr complex< _Tp > operator+(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x plus y.
constexpr _Tp * to_address(_Tp *__ptr) noexcept
Obtain address referenced by a pointer to an object.
__bool_constant< true > true_type
The type used as a compile-time boolean with true value.
__bool_constant< false > false_type
The type used as a compile-time boolean with false value.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
constexpr const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
constexpr iterator_traits< _Iter >::iterator_category __iterator_category(const _Iter &)
ISO C++ entities toplevel namespace is std.
constexpr iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
constexpr void advance(_InputIterator &__i, _Distance __n)
A generalization of pointer arithmetic.
Primary class template hash.
typename __detected_or_t< is_empty< _Alloc >, __equal, _Alloc >::type is_always_equal
Whether all instances of the allocator type compare equal.
The ranges::subrange class template.
Forward iterators support a superset of input iterator operations.
Random-access iterators support a superset of bidirectional iterator operations.
ptrdiff_t difference_type
Distance between iterators is represented as this type.
A standard container which offers fixed time access to individual elements in any order.
constexpr iterator insert(const_iterator __position, const value_type &__x)
Inserts given value into vector before specified iterator.
constexpr void push_back(const value_type &__x)
Add data to the end of the vector.
constexpr reverse_iterator rbegin() noexcept
constexpr iterator end() noexcept
vector()=default
Creates a vector with no elements.
constexpr iterator emplace(const_iterator __position, _Args &&... __args)
Inserts an object in vector before specified iterator.
constexpr iterator begin() noexcept
constexpr size_type capacity() const noexcept
constexpr ~vector() noexcept
constexpr void assign(size_type __n, const value_type &__val)
Assigns a given value to a vector.
constexpr _Tp * data() noexcept
constexpr vector & operator=(const vector &__x)
Vector assignment operator.
constexpr void pop_back() noexcept
Removes last element.
constexpr void reserve(size_type __n)
Attempt to preallocate enough memory for specified number of elements.
constexpr reference at(size_type __n)
Provides access to the data contained in the vector.
constexpr void resize(size_type __new_size)
Resizes the vector to the specified number of elements.
constexpr void _M_range_check(size_type __n) const
Safety check used only from at().
constexpr reference front() noexcept
constexpr iterator erase(const_iterator __position)
Remove element at given position.
constexpr bool empty() const noexcept
constexpr reverse_iterator rend() noexcept
constexpr const_reverse_iterator crbegin() const noexcept
constexpr const_iterator cbegin() const noexcept
constexpr void clear() noexcept
constexpr allocator_type get_allocator() const noexcept
Get a copy of the memory allocation object.
constexpr size_type size() const noexcept
constexpr reference back() noexcept
constexpr const_reverse_iterator crend() const noexcept
constexpr const_iterator cend() const noexcept
constexpr reference operator[](size_type __n) noexcept
Subscript access to the data contained in the vector.
constexpr void shrink_to_fit()
constexpr size_type max_size() const noexcept
Uniform interface to C++98 and C++11 allocators.
static constexpr pointer allocate(_Alloc &__a, size_type __n)
Allocate memory.
static constexpr void deallocate(_Alloc &__a, pointer __p, size_type __n)
Deallocate memory.