87 rebind<_Tp>::other _Tp_alloc_type;
88 typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer
91 struct _Vector_impl_data
95 pointer _M_end_of_storage;
97 _Vector_impl_data() _GLIBCXX_NOEXCEPT
98 : _M_start(), _M_finish(), _M_end_of_storage()
101#if __cplusplus >= 201103L
102 _Vector_impl_data(_Vector_impl_data&& __x) noexcept
103 : _M_start(__x._M_start), _M_finish(__x._M_finish),
104 _M_end_of_storage(__x._M_end_of_storage)
105 { __x._M_start = __x._M_finish = __x._M_end_of_storage = pointer(); }
109 _M_copy_data(_Vector_impl_data
const& __x) _GLIBCXX_NOEXCEPT
111 _M_start = __x._M_start;
112 _M_finish = __x._M_finish;
113 _M_end_of_storage = __x._M_end_of_storage;
117 _M_swap_data(_Vector_impl_data& __x) _GLIBCXX_NOEXCEPT
121 _Vector_impl_data __tmp;
122 __tmp._M_copy_data(*
this);
124 __x._M_copy_data(__tmp);
129 :
public _Tp_alloc_type,
public _Vector_impl_data
131 _Vector_impl() _GLIBCXX_NOEXCEPT_IF(
136 _Vector_impl(_Tp_alloc_type
const& __a) _GLIBCXX_NOEXCEPT
137 : _Tp_alloc_type(__a)
140#if __cplusplus >= 201103L
143 _Vector_impl(_Vector_impl&& __x) noexcept
147 _Vector_impl(_Tp_alloc_type&& __a) noexcept
151 _Vector_impl(_Tp_alloc_type&& __a, _Vector_impl&& __rv) noexcept
156#if _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
157 template<
typename = _Tp_alloc_type>
163 static void _S_shrink(_Vector_impl&,
size_type) { }
164 static void _S_on_dealloc(_Vector_impl&) { }
166 typedef _Vector_impl& _Reinit;
176 template<
typename _Up>
185 _S_adjust(_Vector_impl& __impl, pointer __prev, pointer __curr)
187 __sanitizer_annotate_contiguous_container(__impl._M_start,
188 __impl._M_end_of_storage, __prev, __curr);
192 _S_grow(_Vector_impl& __impl,
size_type __n)
193 { _S_adjust(__impl, __impl._M_finish, __impl._M_finish + __n); }
196 _S_shrink(_Vector_impl& __impl,
size_type __n)
197 { _S_adjust(__impl, __impl._M_finish + __n, __impl._M_finish); }
200 _S_on_dealloc(_Vector_impl& __impl)
203 _S_adjust(__impl, __impl._M_finish, __impl._M_end_of_storage);
209 explicit _Reinit(_Vector_impl& __impl) : _M_impl(__impl)
212 _S_on_dealloc(_M_impl);
218 if (_M_impl._M_start)
219 _S_adjust(_M_impl, _M_impl._M_end_of_storage,
223 _Vector_impl& _M_impl;
225#if __cplusplus >= 201103L
226 _Reinit(
const _Reinit&) =
delete;
227 _Reinit& operator=(
const _Reinit&) =
delete;
234 _Grow(_Vector_impl& __impl,
size_type __n)
235 : _M_impl(__impl), _M_n(__n)
236 { _S_grow(_M_impl, __n); }
238 ~_Grow() {
if (_M_n) _S_shrink(_M_impl, _M_n); }
240 void _M_grew(
size_type __n) { _M_n -= __n; }
242#if __cplusplus >= 201103L
243 _Grow(
const _Grow&) =
delete;
244 _Grow& operator=(
const _Grow&) =
delete;
247 _Vector_impl& _M_impl;
252#define _GLIBCXX_ASAN_ANNOTATE_REINIT \
253 typename _Base::_Vector_impl::template _Asan<>::_Reinit const \
254 __attribute__((__unused__)) __reinit_guard(this->_M_impl)
255#define _GLIBCXX_ASAN_ANNOTATE_GROW(n) \
256 typename _Base::_Vector_impl::template _Asan<>::_Grow \
257 __attribute__((__unused__)) __grow_guard(this->_M_impl, (n))
258#define _GLIBCXX_ASAN_ANNOTATE_GREW(n) __grow_guard._M_grew(n)
259#define _GLIBCXX_ASAN_ANNOTATE_SHRINK(n) \
260 _Base::_Vector_impl::template _Asan<>::_S_shrink(this->_M_impl, n)
261#define _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC \
262 _Base::_Vector_impl::template _Asan<>::_S_on_dealloc(this->_M_impl)
264#define _GLIBCXX_ASAN_ANNOTATE_REINIT
265#define _GLIBCXX_ASAN_ANNOTATE_GROW(n)
266#define _GLIBCXX_ASAN_ANNOTATE_GREW(n)
267#define _GLIBCXX_ASAN_ANNOTATE_SHRINK(n)
268#define _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC
273 typedef _Alloc allocator_type;
276 _M_get_Tp_allocator() _GLIBCXX_NOEXCEPT
277 {
return this->_M_impl; }
279 const _Tp_alloc_type&
280 _M_get_Tp_allocator()
const _GLIBCXX_NOEXCEPT
281 {
return this->_M_impl; }
285 {
return allocator_type(_M_get_Tp_allocator()); }
287#if __cplusplus >= 201103L
293 _Vector_base(
const allocator_type& __a) _GLIBCXX_NOEXCEPT
297#if !_GLIBCXX_INLINE_VERSION
298 _Vector_base(
size_t __n)
300 { _M_create_storage(__n); }
303 _Vector_base(
size_t __n,
const allocator_type& __a)
305 { _M_create_storage(__n); }
307#if __cplusplus >= 201103L
308 _Vector_base(_Vector_base&&) =
default;
311# if !_GLIBCXX_INLINE_VERSION
312 _Vector_base(_Tp_alloc_type&& __a) noexcept
315 _Vector_base(_Vector_base&& __x,
const allocator_type& __a)
318 if (__x.get_allocator() == __a)
319 this->_M_impl._M_swap_data(__x._M_impl);
322 size_t __n = __x._M_impl._M_finish - __x._M_impl._M_start;
323 _M_create_storage(__n);
328 _Vector_base(
const allocator_type& __a, _Vector_base&& __x)
329 : _M_impl(_Tp_alloc_type(__a), std::
move(__x._M_impl))
333 ~_Vector_base() _GLIBCXX_NOEXCEPT
335 _M_deallocate(_M_impl._M_start,
336 _M_impl._M_end_of_storage - _M_impl._M_start);
340 _Vector_impl _M_impl;
343 _M_allocate(
size_t __n)
345 typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr;
346 return __n != 0 ? _Tr::allocate(_M_impl, __n) : pointer();
350 _M_deallocate(pointer __p,
size_t __n)
352 typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr;
354 _Tr::deallocate(_M_impl, __p, __n);
359 _M_create_storage(
size_t __n)
361 this->_M_impl._M_start = this->_M_allocate(__n);
362 this->_M_impl._M_finish = this->_M_impl._M_start;
363 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
389 class vector :
protected _Vector_base<_Tp, _Alloc>
391#ifdef _GLIBCXX_CONCEPT_CHECKS
393 typedef typename _Alloc::value_type _Alloc_value_type;
394# if __cplusplus < 201103L
395 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
397 __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
400#if __cplusplus >= 201103L
402 "std::vector must have a non-const, non-volatile value_type");
403# if __cplusplus > 201703L || defined __STRICT_ANSI__
404 static_assert(is_same<typename _Alloc::value_type, _Tp>::value,
405 "std::vector must have the same value_type as its allocator");
409 typedef _Vector_base<_Tp, _Alloc> _Base;
410 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
414 typedef _Tp value_type;
415 typedef typename _Base::pointer pointer;
416 typedef typename _Alloc_traits::const_pointer const_pointer;
417 typedef typename _Alloc_traits::reference reference;
418 typedef typename _Alloc_traits::const_reference const_reference;
419 typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;
420 typedef __gnu_cxx::__normal_iterator<const_pointer, vector>
424 typedef size_t size_type;
425 typedef ptrdiff_t difference_type;
426 typedef _Alloc allocator_type;
429#if __cplusplus >= 201103L
430 static constexpr bool
439 static constexpr bool
443 static constexpr bool
449 return _S_nothrow_relocate(__is_move_insertable<_Tp_alloc_type>{});
453 _S_do_relocate(pointer __first, pointer __last, pointer __result,
454 _Tp_alloc_type& __alloc,
true_type)
noexcept
456 return std::__relocate_a(__first, __last, __result, __alloc);
460 _S_do_relocate(pointer, pointer, pointer __result,
465 _S_relocate(pointer __first, pointer __last, pointer __result,
466 _Tp_alloc_type& __alloc)
noexcept
468 using __do_it = __bool_constant<_S_use_relocate()>;
469 return _S_do_relocate(__first, __last, __result, __alloc, __do_it{});
474 using _Base::_M_allocate;
475 using _Base::_M_deallocate;
476 using _Base::_M_impl;
477 using _Base::_M_get_Tp_allocator;
486#if __cplusplus >= 201103L
497 vector(
const allocator_type& __a) _GLIBCXX_NOEXCEPT
500#if __cplusplus >= 201103L
510 vector(size_type __n,
const allocator_type& __a = allocator_type())
511 : _Base(_S_check_init_len(__n, __a), __a)
512 { _M_default_initialize(__n); }
522 vector(size_type __n,
const value_type& __value,
523 const allocator_type& __a = allocator_type())
524 : _Base(_S_check_init_len(__n, __a), __a)
525 { _M_fill_initialize(__n, __value); }
537 const allocator_type& __a = allocator_type())
538 : _Base(_S_check_init_len(__n, __a), __a)
539 { _M_fill_initialize(__n, __value); }
555 _Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator()))
557 this->_M_impl._M_finish =
558 std::__uninitialized_copy_a(__x.
begin(), __x.
end(),
559 this->_M_impl._M_start,
560 _M_get_Tp_allocator());
563#if __cplusplus >= 201103L
576 : _Base(__x.
size(), __a)
578 this->_M_impl._M_finish =
579 std::__uninitialized_copy_a(__x.begin(), __x.end(),
580 this->_M_impl._M_start,
581 _M_get_Tp_allocator());
589 vector(vector&& __rv,
const allocator_type& __m, false_type)
592 if (__rv.get_allocator() == __m)
593 this->_M_impl._M_swap_data(__rv._M_impl);
594 else if (!__rv.empty())
596 this->_M_create_storage(__rv.size());
597 this->_M_impl._M_finish =
598 std::__uninitialized_move_a(__rv.begin(), __rv.end(),
599 this->_M_impl._M_start,
600 _M_get_Tp_allocator());
611 :
vector(
std::
move(__rv), __m, typename _Alloc_traits::is_always_equal{})
626 const allocator_type& __a = allocator_type())
629 _M_range_initialize(__l.begin(), __l.end(),
650#if __cplusplus >= 201103L
651 template<
typename _InputIterator,
652 typename = std::_RequireInputIter<_InputIterator>>
653 vector(_InputIterator __first, _InputIterator __last,
654 const allocator_type& __a = allocator_type())
657 _M_range_initialize(__first, __last,
661 template<
typename _InputIterator>
662 vector(_InputIterator __first, _InputIterator __last,
663 const allocator_type& __a = allocator_type())
667 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
668 _M_initialize_dispatch(__first, __last, _Integral());
680 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
681 _M_get_Tp_allocator());
682 _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC;
697#if __cplusplus >= 201103L
711 constexpr bool __move_storage =
712 _Alloc_traits::_S_propagate_on_move_assign()
713 || _Alloc_traits::_S_always_equal();
714 _M_move_assign(
std::move(__x), __bool_constant<__move_storage>());
732 this->_M_assign_aux(__l.begin(), __l.end(),
749 assign(size_type __n,
const value_type& __val)
750 { _M_fill_assign(__n, __val); }
764#if __cplusplus >= 201103L
765 template<
typename _InputIterator,
766 typename = std::_RequireInputIter<_InputIterator>>
768 assign(_InputIterator __first, _InputIterator __last)
769 { _M_assign_dispatch(__first, __last, __false_type()); }
771 template<
typename _InputIterator>
773 assign(_InputIterator __first, _InputIterator __last)
776 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
777 _M_assign_dispatch(__first, __last, _Integral());
781#if __cplusplus >= 201103L
796 this->_M_assign_aux(__l.begin(), __l.end(),
802 using _Base::get_allocator;
812 {
return iterator(this->_M_impl._M_start); }
821 {
return const_iterator(this->_M_impl._M_start); }
830 {
return iterator(this->_M_impl._M_finish); }
838 end() const _GLIBCXX_NOEXCEPT
839 {
return const_iterator(this->_M_impl._M_finish); }
848 {
return reverse_iterator(
end()); }
855 const_reverse_iterator
857 {
return const_reverse_iterator(
end()); }
866 {
return reverse_iterator(
begin()); }
873 const_reverse_iterator
875 {
return const_reverse_iterator(
begin()); }
877#if __cplusplus >= 201103L
885 {
return const_iterator(this->_M_impl._M_start); }
894 {
return const_iterator(this->_M_impl._M_finish); }
901 const_reverse_iterator
903 {
return const_reverse_iterator(
end()); }
910 const_reverse_iterator
912 {
return const_reverse_iterator(
begin()); }
919 {
return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
924 {
return _S_max_size(_M_get_Tp_allocator()); }
926#if __cplusplus >= 201103L
939 if (__new_size >
size())
940 _M_default_append(__new_size -
size());
941 else if (__new_size <
size())
942 _M_erase_at_end(this->_M_impl._M_start + __new_size);
957 resize(size_type __new_size,
const value_type& __x)
959 if (__new_size >
size())
960 _M_fill_insert(
end(), __new_size -
size(), __x);
961 else if (__new_size <
size())
962 _M_erase_at_end(this->_M_impl._M_start + __new_size);
979 if (__new_size >
size())
980 _M_fill_insert(
end(), __new_size -
size(), __x);
981 else if (__new_size <
size())
982 _M_erase_at_end(this->_M_impl._M_start + __new_size);
986#if __cplusplus >= 201103L
990 { _M_shrink_to_fit(); }
999 {
return size_type(this->_M_impl._M_end_of_storage
1000 - this->_M_impl._M_start); }
1006 _GLIBCXX_NODISCARD
bool
1045 __glibcxx_requires_subscript(__n);
1046 return *(this->_M_impl._M_start + __n);
1063 __glibcxx_requires_subscript(__n);
1064 return *(this->_M_impl._M_start + __n);
1072 if (__n >= this->
size())
1073 __throw_out_of_range_fmt(__N(
"vector::_M_range_check: __n "
1074 "(which is %zu) >= this->size() "
1095 return (*
this)[__n];
1113 return (*
this)[__n];
1123 __glibcxx_requires_nonempty();
1134 __glibcxx_requires_nonempty();
1145 __glibcxx_requires_nonempty();
1146 return *(
end() - 1);
1156 __glibcxx_requires_nonempty();
1157 return *(
end() - 1);
1169 {
return _M_data_ptr(this->_M_impl._M_start); }
1172 data() const _GLIBCXX_NOEXCEPT
1173 {
return _M_data_ptr(this->_M_impl._M_start); }
1189 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
1191 _GLIBCXX_ASAN_ANNOTATE_GROW(1);
1192 _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
1194 ++this->_M_impl._M_finish;
1195 _GLIBCXX_ASAN_ANNOTATE_GREW(1);
1198 _M_realloc_insert(
end(), __x);
1201#if __cplusplus >= 201103L
1206 template<
typename... _Args>
1207#if __cplusplus > 201402L
1212 emplace_back(_Args&&... __args);
1227 __glibcxx_requires_nonempty();
1228 --this->_M_impl._M_finish;
1229 _Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish);
1230 _GLIBCXX_ASAN_ANNOTATE_SHRINK(1);
1233#if __cplusplus >= 201103L
1246 template<
typename... _Args>
1248 emplace(const_iterator __position, _Args&&... __args)
1263 insert(const_iterator __position,
const value_type& __x);
1277 insert(iterator __position,
const value_type& __x);
1280#if __cplusplus >= 201103L
1293 insert(const_iterator __position, value_type&& __x)
1294 {
return _M_insert_rval(__position,
std::move(__x)); }
1312 auto __offset = __position -
cbegin();
1313 _M_range_insert(
begin() + __offset, __l.begin(), __l.end(),
1315 return begin() + __offset;
1319#if __cplusplus >= 201103L
1335 insert(const_iterator __position, size_type __n,
const value_type& __x)
1337 difference_type __offset = __position -
cbegin();
1338 _M_fill_insert(
begin() + __offset, __n, __x);
1339 return begin() + __offset;
1357 { _M_fill_insert(__position, __n, __x); }
1360#if __cplusplus >= 201103L
1376 template<
typename _InputIterator,
1377 typename = std::_RequireInputIter<_InputIterator>>
1379 insert(const_iterator __position, _InputIterator __first,
1380 _InputIterator __last)
1382 difference_type __offset = __position -
cbegin();
1383 _M_insert_dispatch(
begin() + __offset,
1384 __first, __last, __false_type());
1385 return begin() + __offset;
1402 template<
typename _InputIterator>
1405 _InputIterator __last)
1408 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
1409 _M_insert_dispatch(__position, __first, __last, _Integral());
1429#if __cplusplus >= 201103L
1431 {
return _M_erase(
begin() + (__position -
cbegin())); }
1434 {
return _M_erase(__position); }
1456#if __cplusplus >= 201103L
1457 erase(const_iterator __first, const_iterator __last)
1459 const auto __beg =
begin();
1460 const auto __cbeg =
cbegin();
1461 return _M_erase(__beg + (__first - __cbeg), __beg + (__last - __cbeg));
1465 {
return _M_erase(__first, __last); }
1482#if __cplusplus >= 201103L
1483 __glibcxx_assert(_Alloc_traits::propagate_on_container_swap::value
1484 || _M_get_Tp_allocator() == __x._M_get_Tp_allocator());
1486 this->_M_impl._M_swap_data(__x._M_impl);
1487 _Alloc_traits::_S_on_swap(_M_get_Tp_allocator(),
1488 __x._M_get_Tp_allocator());
1499 { _M_erase_at_end(this->_M_impl._M_start); }
1506 template<
typename _ForwardIterator>
1509 _ForwardIterator __first, _ForwardIterator __last)
1511 pointer __result = this->_M_allocate(__n);
1514 std::__uninitialized_copy_a(__first, __last, __result,
1515 _M_get_Tp_allocator());
1520 _M_deallocate(__result, __n);
1521 __throw_exception_again;
1530#if __cplusplus < 201103L
1533 template<
typename _Integer>
1535 _M_initialize_dispatch(_Integer __n, _Integer __value, __true_type)
1537 this->_M_impl._M_start = _M_allocate(_S_check_init_len(
1538 static_cast<size_type>(__n), _M_get_Tp_allocator()));
1539 this->_M_impl._M_end_of_storage =
1540 this->_M_impl._M_start +
static_cast<size_type>(__n);
1541 _M_fill_initialize(
static_cast<size_type>(__n), __value);
1545 template<
typename _InputIterator>
1547 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
1550 _M_range_initialize(__first, __last,
1556 template<
typename _InputIterator>
1558 _M_range_initialize(_InputIterator __first, _InputIterator __last,
1559 std::input_iterator_tag)
1562 for (; __first != __last; ++__first)
1563#
if __cplusplus >= 201103L
1564 emplace_back(*__first);
1570 __throw_exception_again;
1575 template<
typename _ForwardIterator>
1577 _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
1578 std::forward_iterator_tag)
1581 this->_M_impl._M_start
1582 = this->_M_allocate(_S_check_init_len(__n, _M_get_Tp_allocator()));
1583 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
1584 this->_M_impl._M_finish =
1585 std::__uninitialized_copy_a(__first, __last,
1586 this->_M_impl._M_start,
1587 _M_get_Tp_allocator());
1593 _M_fill_initialize(size_type __n,
const value_type& __value)
1595 this->_M_impl._M_finish =
1596 std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
1597 _M_get_Tp_allocator());
1600#if __cplusplus >= 201103L
1603 _M_default_initialize(size_type __n)
1605 this->_M_impl._M_finish =
1606 std::__uninitialized_default_n_a(this->_M_impl._M_start, __n,
1607 _M_get_Tp_allocator());
1618 template<
typename _Integer>
1620 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
1621 { _M_fill_assign(__n, __val); }
1624 template<
typename _InputIterator>
1626 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
1631 template<
typename _InputIterator>
1633 _M_assign_aux(_InputIterator __first, _InputIterator __last,
1634 std::input_iterator_tag);
1637 template<
typename _ForwardIterator>
1639 _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
1640 std::forward_iterator_tag);
1645 _M_fill_assign(size_type __n,
const value_type& __val);
1653 template<
typename _Integer>
1655 _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
1657 { _M_fill_insert(__pos, __n, __val); }
1660 template<
typename _InputIterator>
1662 _M_insert_dispatch(iterator __pos, _InputIterator __first,
1663 _InputIterator __last, __false_type)
1665 _M_range_insert(__pos, __first, __last,
1670 template<
typename _InputIterator>
1672 _M_range_insert(iterator __pos, _InputIterator __first,
1673 _InputIterator __last, std::input_iterator_tag);
1676 template<
typename _ForwardIterator>
1678 _M_range_insert(iterator __pos, _ForwardIterator __first,
1679 _ForwardIterator __last, std::forward_iterator_tag);
1684 _M_fill_insert(iterator __pos, size_type __n,
const value_type& __x);
1686#if __cplusplus >= 201103L
1689 _M_default_append(size_type __n);
1695#if __cplusplus < 201103L
1698 _M_insert_aux(iterator __position,
const value_type& __x);
1701 _M_realloc_insert(iterator __position,
const value_type& __x);
1705 struct _Temporary_value
1707 template<
typename... _Args>
1709 _Temporary_value(
vector* __vec, _Args&&... __args) : _M_this(__vec)
1711 _Alloc_traits::construct(_M_this->_M_impl, _M_ptr(),
1716 { _Alloc_traits::destroy(_M_this->_M_impl, _M_ptr()); }
1719 _M_val() {
return *_M_ptr(); }
1723 _M_ptr() {
return reinterpret_cast<_Tp*
>(&__buf); }
1726 typename aligned_storage<
sizeof(_Tp),
alignof(_Tp)>::type __buf;
1731 template<
typename _Arg>
1733 _M_insert_aux(iterator __position, _Arg&& __arg);
1735 template<
typename... _Args>
1737 _M_realloc_insert(iterator __position, _Args&&... __args);
1741 _M_insert_rval(const_iterator __position, value_type&& __v);
1744 template<
typename... _Args>
1746 _M_emplace_aux(const_iterator __position, _Args&&... __args);
1750 _M_emplace_aux(const_iterator __position, value_type&& __v)
1751 {
return _M_insert_rval(__position,
std::move(__v)); }
1756 _M_check_len(size_type __n,
const char* __s)
const
1759 __throw_length_error(__N(__s));
1767 _S_check_init_len(size_type __n,
const allocator_type& __a)
1769 if (__n > _S_max_size(_Tp_alloc_type(__a)))
1770 __throw_length_error(
1771 __N(
"cannot create std::vector larger than max_size()"));
1776 _S_max_size(
const _Tp_alloc_type& __a) _GLIBCXX_NOEXCEPT
1781 const size_t __diffmax
1782 = __gnu_cxx::__numeric_traits<ptrdiff_t>::__max /
sizeof(_Tp);
1784 return (
std::min)(__diffmax, __allocmax);
1792 _M_erase_at_end(pointer __pos) _GLIBCXX_NOEXCEPT
1794 if (size_type __n = this->_M_impl._M_finish - __pos)
1797 _M_get_Tp_allocator());
1798 this->_M_impl._M_finish = __pos;
1799 _GLIBCXX_ASAN_ANNOTATE_SHRINK(__n);
1804 _M_erase(iterator __position);
1807 _M_erase(iterator __first, iterator __last);
1809#if __cplusplus >= 201103L
1818 this->_M_impl._M_swap_data(__x._M_impl);
1819 __tmp._M_impl._M_swap_data(__x._M_impl);
1820 std::__alloc_on_move(_M_get_Tp_allocator(), __x._M_get_Tp_allocator());
1828 if (__x._M_get_Tp_allocator() == this->_M_get_Tp_allocator())
1834 this->_M_assign_aux(std::make_move_iterator(__x.begin()),
1835 std::make_move_iterator(__x.end()),
1836 std::random_access_iterator_tag());
1842 template<
typename _Up>
1844 _M_data_ptr(_Up* __ptr)
const _GLIBCXX_NOEXCEPT
1847#if __cplusplus >= 201103L
1848 template<
typename _Ptr>
1849 typename std::pointer_traits<_Ptr>::element_type*
1850 _M_data_ptr(_Ptr __ptr)
const
1851 {
return empty() ? nullptr : std::__to_address(__ptr); }
1853 template<
typename _Up>
1855 _M_data_ptr(_Up* __ptr) _GLIBCXX_NOEXCEPT
1858 template<
typename _Ptr>
1860 _M_data_ptr(_Ptr __ptr)
1861 {
return empty() ? (value_type*)0 : __ptr.operator->(); }
1863 template<
typename _Ptr>
1865 _M_data_ptr(_Ptr __ptr)
const
1866 {
return empty() ? (
const value_type*)0 : __ptr.operator->(); }