56 #ifndef _STL_BVECTOR_H 57 #define _STL_BVECTOR_H 1 59 #if __cplusplus >= 201103L 64 namespace std _GLIBCXX_VISIBILITY(default)
66 _GLIBCXX_BEGIN_NAMESPACE_VERSION
67 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
69 typedef unsigned long _Bit_type;
70 enum { _S_word_bit = int(__CHAR_BIT__ *
sizeof(_Bit_type)) };
77 _Bit_reference(_Bit_type * __x, _Bit_type __y)
78 : _M_p(__x), _M_mask(__y) { }
80 _Bit_reference() _GLIBCXX_NOEXCEPT : _M_p(0), _M_mask(0) { }
82 operator bool() const _GLIBCXX_NOEXCEPT
83 {
return !!(*_M_p & _M_mask); }
86 operator=(
bool __x) _GLIBCXX_NOEXCEPT
96 operator=(
const _Bit_reference& __x) _GLIBCXX_NOEXCEPT
97 {
return *
this = bool(__x); }
100 operator==(
const _Bit_reference& __x)
const 101 {
return bool(*
this) == bool(__x); }
104 operator<(
const _Bit_reference& __x)
const 105 {
return !bool(*
this) && bool(__x); }
108 flip() _GLIBCXX_NOEXCEPT
109 { *_M_p ^= _M_mask; }
112 #if __cplusplus >= 201103L 114 swap(_Bit_reference __x, _Bit_reference __y) noexcept
122 swap(_Bit_reference __x,
bool& __y) noexcept
130 swap(
bool& __x, _Bit_reference __y) noexcept
138 struct _Bit_iterator_base
139 :
public std::iterator<std::random_access_iterator_tag, bool>
142 unsigned int _M_offset;
144 _Bit_iterator_base(_Bit_type * __x,
unsigned int __y)
145 : _M_p(__x), _M_offset(__y) { }
150 if (_M_offset++ ==
int(_S_word_bit) - 1)
160 if (_M_offset-- == 0)
162 _M_offset = int(_S_word_bit) - 1;
168 _M_incr(ptrdiff_t __i)
171 _M_p += __n / int(_S_word_bit);
172 __n = __n % int(_S_word_bit);
175 __n += int(_S_word_bit);
178 _M_offset =
static_cast<unsigned int>(__n);
182 operator==(
const _Bit_iterator_base& __i)
const 183 {
return _M_p == __i._M_p && _M_offset == __i._M_offset; }
186 operator<(
const _Bit_iterator_base& __i)
const 188 return _M_p < __i._M_p
189 || (_M_p == __i._M_p && _M_offset < __i._M_offset);
193 operator!=(
const _Bit_iterator_base& __i)
const 194 {
return !(*
this == __i); }
197 operator>(
const _Bit_iterator_base& __i)
const 198 {
return __i < *
this; }
201 operator<=(
const _Bit_iterator_base& __i)
const 202 {
return !(__i < *
this); }
205 operator>=(
const _Bit_iterator_base& __i)
const 206 {
return !(*
this < __i); }
210 operator-(
const _Bit_iterator_base& __x,
const _Bit_iterator_base& __y)
212 return (
int(_S_word_bit) * (__x._M_p - __y._M_p)
213 + __x._M_offset - __y._M_offset);
216 struct _Bit_iterator :
public _Bit_iterator_base
218 typedef _Bit_reference reference;
219 typedef _Bit_reference* pointer;
220 typedef _Bit_iterator iterator;
222 _Bit_iterator() : _Bit_iterator_base(0, 0) { }
224 _Bit_iterator(_Bit_type * __x,
unsigned int __y)
225 : _Bit_iterator_base(__x, __y) { }
228 _M_const_cast()
const 233 {
return reference(_M_p, 1UL << _M_offset); }
245 iterator __tmp = *
this;
260 iterator __tmp = *
this;
266 operator+=(difference_type __i)
273 operator-=(difference_type __i)
282 iterator __tmp = *
this;
289 iterator __tmp = *
this;
294 operator[](difference_type __i)
const 295 {
return *(*
this + __i); }
299 operator+(ptrdiff_t __n,
const _Bit_iterator& __x)
300 {
return __x + __n; }
302 struct _Bit_const_iterator :
public _Bit_iterator_base
304 typedef bool reference;
305 typedef bool const_reference;
306 typedef const bool* pointer;
307 typedef _Bit_const_iterator const_iterator;
309 _Bit_const_iterator() : _Bit_iterator_base(0, 0) { }
311 _Bit_const_iterator(_Bit_type * __x,
unsigned int __y)
312 : _Bit_iterator_base(__x, __y) { }
314 _Bit_const_iterator(
const _Bit_iterator& __x)
315 : _Bit_iterator_base(__x._M_p, __x._M_offset) { }
318 _M_const_cast()
const 319 {
return _Bit_iterator(_M_p, _M_offset); }
323 {
return _Bit_reference(_M_p, 1UL << _M_offset); }
335 const_iterator __tmp = *
this;
350 const_iterator __tmp = *
this;
356 operator+=(difference_type __i)
363 operator-=(difference_type __i)
372 const_iterator __tmp = *
this;
379 const_iterator __tmp = *
this;
384 operator[](difference_type __i)
const 385 {
return *(*
this + __i); }
388 inline _Bit_const_iterator
389 operator+(ptrdiff_t __n,
const _Bit_const_iterator& __x)
390 {
return __x + __n; }
393 __fill_bvector(_Bit_type * __v,
394 unsigned int __first,
unsigned int __last,
bool __x)
396 const _Bit_type __fmask = ~0ul << __first;
397 const _Bit_type __lmask = ~0ul >> (_S_word_bit - __last);
398 const _Bit_type __mask = __fmask & __lmask;
407 fill(_Bit_iterator __first, _Bit_iterator __last,
const bool& __x)
409 if (__first._M_p != __last._M_p)
411 _Bit_type* __first_p = __first._M_p;
412 if (__first._M_offset != 0)
413 __fill_bvector(__first_p++, __first._M_offset, _S_word_bit, __x);
415 __builtin_memset(__first_p, __x ? ~0 : 0,
416 (__last._M_p - __first_p) *
sizeof(_Bit_type));
418 if (__last._M_offset != 0)
419 __fill_bvector(__last._M_p, 0, __last._M_offset, __x);
421 else if (__first._M_offset != __last._M_offset)
422 __fill_bvector(__first._M_p, __first._M_offset, __last._M_offset, __x);
425 template<
typename _Alloc>
429 rebind<_Bit_type>::other _Bit_alloc_type;
432 typedef typename _Bit_alloc_traits::pointer _Bit_pointer;
434 struct _Bvector_impl_data
436 _Bit_iterator _M_start;
437 _Bit_iterator _M_finish;
438 _Bit_pointer _M_end_of_storage;
440 _Bvector_impl_data() _GLIBCXX_NOEXCEPT
441 : _M_start(), _M_finish(), _M_end_of_storage()
444 #if __cplusplus >= 201103L 445 _Bvector_impl_data(_Bvector_impl_data&& __x) noexcept
446 : _M_start(__x._M_start), _M_finish(__x._M_finish)
447 , _M_end_of_storage(__x._M_end_of_storage)
451 _M_move_data(_Bvector_impl_data&& __x) noexcept
453 this->_M_start = __x._M_start;
454 this->_M_finish = __x._M_finish;
455 this->_M_end_of_storage = __x._M_end_of_storage;
461 _M_reset() _GLIBCXX_NOEXCEPT
463 _M_start = _M_finish = _Bit_iterator();
464 _M_end_of_storage = _Bit_pointer();
469 :
public _Bit_alloc_type,
public _Bvector_impl_data
472 _Bvector_impl() _GLIBCXX_NOEXCEPT_IF(
473 is_nothrow_default_constructible<_Bit_alloc_type>::value)
477 _Bvector_impl(
const _Bit_alloc_type& __a) _GLIBCXX_NOEXCEPT
478 : _Bit_alloc_type(__a)
481 #if __cplusplus >= 201103L 482 _Bvector_impl(_Bvector_impl&&) =
default;
486 _M_end_addr() const _GLIBCXX_NOEXCEPT
488 if (this->_M_end_of_storage)
495 typedef _Alloc allocator_type;
498 _M_get_Bit_allocator() _GLIBCXX_NOEXCEPT
499 {
return this->_M_impl; }
501 const _Bit_alloc_type&
502 _M_get_Bit_allocator() const _GLIBCXX_NOEXCEPT
503 {
return this->_M_impl; }
506 get_allocator() const _GLIBCXX_NOEXCEPT
507 {
return allocator_type(_M_get_Bit_allocator()); }
509 #if __cplusplus >= 201103L 510 _Bvector_base() =
default;
515 _Bvector_base(
const allocator_type& __a)
518 #if __cplusplus >= 201103L 519 _Bvector_base(_Bvector_base&&) =
default;
523 { this->_M_deallocate(); }
526 _Bvector_impl _M_impl;
529 _M_allocate(
size_t __n)
535 if (_M_impl._M_start._M_p)
537 const size_t __n = _M_impl._M_end_addr() - _M_impl._M_start._M_p;
539 _M_impl._M_end_of_storage - __n,
545 #if __cplusplus >= 201103L 547 _M_move_data(_Bvector_base&& __x) noexcept
548 { _M_impl._M_move_data(std::move(__x._M_impl)); }
554 {
return (__n +
int(_S_word_bit) - 1) / int(_S_word_bit); }
557 _GLIBCXX_END_NAMESPACE_CONTAINER
558 _GLIBCXX_END_NAMESPACE_VERSION
564 namespace std _GLIBCXX_VISIBILITY(default)
566 _GLIBCXX_BEGIN_NAMESPACE_VERSION
567 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
588 template<
typename _Alloc>
589 class vector<bool, _Alloc> :
protected _Bvector_base<_Alloc>
591 typedef _Bvector_base<_Alloc> _Base;
592 typedef typename _Base::_Bit_pointer _Bit_pointer;
595 #if __cplusplus >= 201103L 600 typedef bool value_type;
601 typedef size_t size_type;
602 typedef ptrdiff_t difference_type;
603 typedef _Bit_reference reference;
604 typedef bool const_reference;
605 typedef _Bit_reference* pointer;
606 typedef const bool* const_pointer;
607 typedef _Bit_iterator iterator;
608 typedef _Bit_const_iterator const_iterator;
611 typedef _Alloc allocator_type;
614 get_allocator()
const 615 {
return _Base::get_allocator(); }
618 using _Base::_M_allocate;
619 using _Base::_M_deallocate;
620 using _Base::_S_nword;
621 using _Base::_M_get_Bit_allocator;
624 #if __cplusplus >= 201103L 631 vector(
const allocator_type& __a)
634 #if __cplusplus >= 201103L 636 vector(size_type __n,
const allocator_type& __a = allocator_type())
640 vector(size_type __n,
const bool& __value,
641 const allocator_type& __a = allocator_type())
644 vector(size_type __n,
const bool& __value =
bool(),
645 const allocator_type& __a = allocator_type())
649 _M_check_and_initialize(__n);
650 _M_initialize_value(__value);
654 : _Base(_Bit_alloc_traits::_S_select_on_copy(__x._M_get_Bit_allocator()))
656 _M_initialize(__x.
size());
657 _M_copy_aligned(__x.
begin(), __x.
end(), this->_M_impl._M_start);
660 #if __cplusplus >= 201103L 664 noexcept(_Bit_alloc_traits::_S_always_equal())
668 this->_M_move_data(std::move(__x));
671 _M_initialize(__x.
size());
680 _M_initialize(__x.
size());
681 _M_copy_aligned(__x.
begin(), __x.
end(), this->_M_impl._M_start);
685 const allocator_type& __a = allocator_type())
688 _M_initialize_range(__l.begin(), __l.end(),
693 #if __cplusplus >= 201103L 694 template<
typename _InputIterator,
695 typename = std::_RequireInputIter<_InputIterator>>
696 vector(_InputIterator __first, _InputIterator __last,
697 const allocator_type& __a = allocator_type())
699 { _M_initialize_dispatch(__first, __last, __false_type()); }
701 template<
typename _InputIterator>
702 vector(_InputIterator __first, _InputIterator __last,
703 const allocator_type& __a = allocator_type())
706 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
707 _M_initialize_dispatch(__first, __last, _Integral());
711 ~vector() _GLIBCXX_NOEXCEPT { }
718 #if __cplusplus >= 201103L 719 if (_Bit_alloc_traits::_S_propagate_on_copy_assign())
721 if (this->_M_get_Bit_allocator() != __x._M_get_Bit_allocator())
723 this->_M_deallocate();
724 std::__alloc_on_copy(_M_get_Bit_allocator(),
725 __x._M_get_Bit_allocator());
726 _M_initialize(__x.
size());
729 std::__alloc_on_copy(_M_get_Bit_allocator(),
730 __x._M_get_Bit_allocator());
735 this->_M_deallocate();
736 _M_initialize(__x.
size());
738 this->_M_impl._M_finish = _M_copy_aligned(__x.
begin(), __x.
end(),
743 #if __cplusplus >= 201103L 747 if (_Bit_alloc_traits::_S_propagate_on_move_assign()
748 || this->_M_get_Bit_allocator() == __x._M_get_Bit_allocator())
750 this->_M_deallocate();
751 this->_M_move_data(std::move(__x));
752 std::__alloc_on_move(_M_get_Bit_allocator(),
753 __x._M_get_Bit_allocator());
759 this->_M_deallocate();
760 _M_initialize(__x.
size());
762 this->_M_impl._M_finish = _M_copy_aligned(__x.
begin(), __x.
end(),
772 this->
assign (__l.begin(), __l.end());
782 assign(size_type __n,
const bool& __x)
783 { _M_fill_assign(__n, __x); }
785 #if __cplusplus >= 201103L 786 template<
typename _InputIterator,
787 typename = std::_RequireInputIter<_InputIterator>>
789 assign(_InputIterator __first, _InputIterator __last)
792 template<
typename _InputIterator>
794 assign(_InputIterator __first, _InputIterator __last)
796 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
797 _M_assign_dispatch(__first, __last, _Integral());
801 #if __cplusplus >= 201103L 808 begin() _GLIBCXX_NOEXCEPT
809 {
return this->_M_impl._M_start; }
812 begin()
const _GLIBCXX_NOEXCEPT
813 {
return this->_M_impl._M_start; }
816 end() _GLIBCXX_NOEXCEPT
817 {
return this->_M_impl._M_finish; }
820 end()
const _GLIBCXX_NOEXCEPT
821 {
return this->_M_impl._M_finish; }
824 rbegin() _GLIBCXX_NOEXCEPT
828 rbegin()
const _GLIBCXX_NOEXCEPT
832 rend() _GLIBCXX_NOEXCEPT
836 rend()
const _GLIBCXX_NOEXCEPT
839 #if __cplusplus >= 201103L 842 {
return this->_M_impl._M_start; }
845 cend()
const noexcept
846 {
return this->_M_impl._M_finish; }
853 crend()
const noexcept
858 size()
const _GLIBCXX_NOEXCEPT
859 {
return size_type(
end() -
begin()); }
864 const size_type __isize =
865 __gnu_cxx::__numeric_traits<difference_type>::__max
866 - int(_S_word_bit) + 1;
867 const size_type __asize
868 = _Bit_alloc_traits::max_size(_M_get_Bit_allocator());
869 return (__asize <= __isize /
int(_S_word_bit)
870 ? __asize *
int(_S_word_bit) : __isize);
875 {
return size_type(const_iterator(this->_M_impl._M_end_addr(), 0)
879 empty()
const _GLIBCXX_NOEXCEPT
885 return *iterator(this->_M_impl._M_start._M_p
886 + __n /
int(_S_word_bit), __n %
int(_S_word_bit));
892 return *const_iterator(this->_M_impl._M_start._M_p
893 + __n /
int(_S_word_bit), __n %
int(_S_word_bit));
900 if (__n >= this->
size())
901 __throw_out_of_range_fmt(__N(
"vector<bool>::_M_range_check: __n " 902 "(which is %zu) >= this->size() " 913 at(size_type __n)
const 920 __throw_length_error(__N(
"vector::reserve"));
935 {
return *(
end() - 1); }
939 {
return *(
end() - 1); }
947 data() _GLIBCXX_NOEXCEPT { }
952 if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_addr())
953 *this->_M_impl._M_finish++ = __x;
955 _M_insert_aux(
end(), __x);
961 std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
962 std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
963 std::swap(this->_M_impl._M_end_of_storage,
964 __x._M_impl._M_end_of_storage);
965 _Bit_alloc_traits::_S_on_swap(_M_get_Bit_allocator(),
966 __x._M_get_Bit_allocator());
971 swap(reference __x, reference __y) _GLIBCXX_NOEXCEPT
979 #if __cplusplus >= 201103L 980 insert(const_iterator __position,
const bool& __x =
bool())
982 insert(iterator __position,
const bool& __x =
bool())
985 const difference_type __n = __position -
begin();
986 if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_addr()
987 && __position ==
end())
988 *this->_M_impl._M_finish++ = __x;
990 _M_insert_aux(__position._M_const_cast(), __x);
991 return begin() + __n;
994 #if __cplusplus >= 201103L 995 template<
typename _InputIterator,
996 typename = std::_RequireInputIter<_InputIterator>>
998 insert(const_iterator __position,
999 _InputIterator __first, _InputIterator __last)
1001 difference_type __offset = __position -
cbegin();
1002 _M_insert_dispatch(__position._M_const_cast(),
1003 __first, __last, __false_type());
1004 return begin() + __offset;
1007 template<
typename _InputIterator>
1009 insert(iterator __position,
1010 _InputIterator __first, _InputIterator __last)
1012 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
1013 _M_insert_dispatch(__position, __first, __last, _Integral());
1017 #if __cplusplus >= 201103L 1019 insert(const_iterator __position, size_type __n,
const bool& __x)
1021 difference_type __offset = __position -
cbegin();
1022 _M_fill_insert(__position._M_const_cast(), __n, __x);
1023 return begin() + __offset;
1027 insert(iterator __position, size_type __n,
const bool& __x)
1028 { _M_fill_insert(__position, __n, __x); }
1031 #if __cplusplus >= 201103L 1034 {
return this->
insert(__p, __l.begin(), __l.end()); }
1039 { --this->_M_impl._M_finish; }
1042 #if __cplusplus >= 201103L 1043 erase(const_iterator __position)
1045 erase(iterator __position)
1047 {
return _M_erase(__position._M_const_cast()); }
1050 #if __cplusplus >= 201103L 1051 erase(const_iterator __first, const_iterator __last)
1053 erase(iterator __first, iterator __last)
1055 {
return _M_erase(__first._M_const_cast(), __last._M_const_cast()); }
1058 resize(size_type __new_size,
bool __x =
bool())
1060 if (__new_size <
size())
1061 _M_erase_at_end(
begin() + difference_type(__new_size));
1066 #if __cplusplus >= 201103L 1069 { _M_shrink_to_fit(); }
1073 flip() _GLIBCXX_NOEXCEPT
1075 _Bit_type *
const __end = this->_M_impl._M_end_addr();
1076 for (_Bit_type * __p = this->_M_impl._M_start._M_p; __p != __end; ++__p)
1081 clear() _GLIBCXX_NOEXCEPT
1082 { _M_erase_at_end(
begin()); }
1084 #if __cplusplus >= 201103L 1085 template<
typename... _Args>
1086 #if __cplusplus > 201402L 1091 emplace_back(_Args&&... __args)
1094 #if __cplusplus > 201402L 1099 template<
typename... _Args>
1101 emplace(const_iterator __pos, _Args&&... __args)
1102 {
return insert(__pos,
bool(__args...)); }
1108 _M_copy_aligned(const_iterator __first, const_iterator __last,
1111 _Bit_type* __q = std::copy(__first._M_p, __last._M_p, __result._M_p);
1112 return std::copy(const_iterator(__last._M_p, 0), __last,
1117 _M_initialize(size_type __n)
1120 _GLIBCXX_DEBUG_ASSERT(__n <= (
size_t)-_S_word_bit);
1124 _Bit_pointer __q = this->_M_allocate(__n);
1125 this->_M_impl._M_end_of_storage = __q + _S_nword(__n);
1130 this->_M_impl._M_end_of_storage = _Bit_pointer();
1131 this->_M_impl._M_start = iterator(0, 0);
1133 this->_M_impl._M_finish = this->_M_impl._M_start + difference_type(__n);
1137 template<
typename _SizeT>
1139 _M_check_and_initialize(_SizeT __n)
1142 __throw_length_error(
1143 __N(
"Cannot create std::vector<bool> larger than max_size()"));
1144 _M_initialize(static_cast<size_type>(__n));
1148 _M_initialize_value(
bool __x)
1150 if (_Bit_type* __p = this->_M_impl._M_start._M_p)
1151 __builtin_memset(__p, __x ? ~0 : 0,
1152 (this->_M_impl._M_end_addr() - __p)
1153 *
sizeof(_Bit_type));
1157 _M_reallocate(size_type __n);
1159 #if __cplusplus >= 201103L 1168 template<
typename _Integer>
1170 _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
1172 _M_check_and_initialize(static_cast<size_type>(__n));
1173 _M_initialize_value(__x);
1176 template<
typename _InputIterator>
1178 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
1180 { _M_initialize_range(__first, __last,
1183 template<
typename _InputIterator>
1185 _M_initialize_range(_InputIterator __first, _InputIterator __last,
1188 for (; __first != __last; ++__first)
1192 template<
typename _ForwardIterator>
1194 _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
1198 std::copy(__first, __last, this->_M_impl._M_start);
1201 #if __cplusplus < 201103L 1204 template<
typename _Integer>
1206 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
1207 { _M_fill_assign(__n, __val); }
1209 template<
class _InputIterator>
1211 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
1217 _M_fill_assign(
size_t __n,
bool __x)
1221 _M_initialize_value(__x);
1226 _M_erase_at_end(
begin() + __n);
1227 _M_initialize_value(__x);
1231 template<
typename _InputIterator>
1233 _M_assign_aux(_InputIterator __first, _InputIterator __last,
1236 iterator __cur =
begin();
1237 for (; __first != __last && __cur !=
end(); ++__cur, ++__first)
1239 if (__first == __last)
1240 _M_erase_at_end(__cur);
1245 template<
typename _ForwardIterator>
1247 _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
1252 _M_erase_at_end(std::copy(__first, __last,
begin()));
1255 _ForwardIterator __mid = __first;
1257 std::copy(__first, __mid,
begin());
1266 template<
typename _Integer>
1268 _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
1270 { _M_fill_insert(__pos, __n, __x); }
1272 template<
typename _InputIterator>
1274 _M_insert_dispatch(iterator __pos,
1275 _InputIterator __first, _InputIterator __last,
1277 { _M_insert_range(__pos, __first, __last,
1281 _M_fill_insert(iterator __position, size_type __n,
bool __x);
1283 template<
typename _InputIterator>
1285 _M_insert_range(iterator __pos, _InputIterator __first,
1288 for (; __first != __last; ++__first)
1290 __pos =
insert(__pos, *__first);
1295 template<
typename _ForwardIterator>
1297 _M_insert_range(iterator __position, _ForwardIterator __first,
1301 _M_insert_aux(iterator __position,
bool __x);
1304 _M_check_len(size_type __n,
const char* __s)
const 1307 __throw_length_error(__N(__s));
1314 _M_erase_at_end(iterator __pos)
1315 { this->_M_impl._M_finish = __pos; }
1318 _M_erase(iterator __pos);
1321 _M_erase(iterator __first, iterator __last);
1324 _GLIBCXX_END_NAMESPACE_CONTAINER
1325 _GLIBCXX_END_NAMESPACE_VERSION
1328 #if __cplusplus >= 201103L 1330 namespace std _GLIBCXX_VISIBILITY(default)
1332 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1336 template<
typename _Alloc>
1338 :
public __hash_base<size_t, _GLIBCXX_STD_C::vector<bool, _Alloc>>
1341 operator()(
const _GLIBCXX_STD_C::vector<bool, _Alloc>&)
const noexcept;
1344 _GLIBCXX_END_NAMESPACE_VERSION
complex< _Tp > operator-(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x minus y.
reference operator[](size_type __n) noexcept
Subscript access to the data contained in the vector.
void reserve(size_type __n)
Attempt to preallocate enough memory for specified number of elements.
Random-access iterators support a superset of bidirectional iterator operations.
_GLIBCXX17_CONSTEXPR iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
complex< _Tp > operator+(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x plus y.
reference front() noexcept
const_iterator cbegin() const noexcept
Primary class template hash.
void push_back(const value_type &__x)
Add data to the end of the vector.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
ptrdiff_t difference_type
Distance between iterators is represented as this type.
_GLIBCXX17_CONSTEXPR void advance(_InputIterator &__i, _Distance __n)
A generalization of pointer arithmetic.
void swap(vector &__x) noexcept
Swaps data with another vector.
static void deallocate(_Alloc &__a, pointer __p, size_type __n)
Deallocate memory.
const_iterator cend() const noexcept
complex< _Tp > operator*(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x times y.
reference back() noexcept
vector & operator=(const vector &__x)
Vector assignment operator.
allocator_type get_allocator() const noexcept
Get a copy of the memory allocation object.
const_reverse_iterator crend() const noexcept
ISO C++ entities toplevel namespace is std.
iterator erase(const_iterator __position)
Remove element at given position.
void _M_range_check(size_type __n) const
Safety check used only from at().
iterator begin() noexcept
reverse_iterator rbegin() noexcept
constexpr iterator_traits< _Iter >::iterator_category __iterator_category(const _Iter &)
vector() noexcept(is_nothrow_default_constructible< _Alloc >::value)
Creates a vector with no elements.
const_reverse_iterator crbegin() const noexcept
void resize(size_type __new_size)
Resizes the vector to the specified number of elements.
bool empty() const noexcept
iterator emplace(const_iterator __position, _Args &&... __args)
Inserts an object in vector before specified iterator.
reverse_iterator rend() noexcept
A standard container which offers fixed time access to individual elements in any order...
reference at(size_type __n)
Provides access to the data contained in the vector.
void assign(size_type __n, const value_type &__val)
Assigns a given value to a vector.
size_type size() const noexcept
size_type max_size() const noexcept
void pop_back() noexcept
Removes last element.
iterator insert(const_iterator __position, const value_type &__x)
Inserts given value into vector before specified iterator.
Uniform interface to C++98 and C++11 allocators.
static pointer allocate(_Alloc &__a, size_type __n)
Allocate memory.
Forward iterators support a superset of input iterator operations.
_GLIBCXX14_CONSTEXPR const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
size_type capacity() const noexcept