40 template<
typename _Tp,
41 typename _Allocator = std::allocator<_Tp> >
43 :
public _GLIBCXX_STD_C::vector<_Tp, _Allocator>
45 typedef _GLIBCXX_STD_C::vector<_Tp, _Allocator> _Base;
47 #if __cplusplus >= 201103L
48 typedef __gnu_cxx::__alloc_traits<_Allocator> _Alloc_traits;
52 typedef typename _Base::reference reference;
53 typedef typename _Base::const_reference const_reference;
55 typedef __iterator_tracker<typename _Base::iterator, vector>
57 typedef __iterator_tracker<typename _Base::const_iterator, vector>
60 typedef typename _Base::size_type size_type;
61 typedef typename _Base::difference_type difference_type;
63 typedef _Tp value_type;
64 typedef _Allocator allocator_type;
65 typedef typename _Base::pointer pointer;
66 typedef typename _Base::const_pointer const_pointer;
67 typedef std::reverse_iterator<iterator> reverse_iterator;
68 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
71 _M_base() _GLIBCXX_NOEXCEPT {
return *
this; }
74 _M_base() const _GLIBCXX_NOEXCEPT {
return *
this; }
78 vector(
const _Allocator& __a = _Allocator())
85 #if __cplusplus >= 201103L
87 vector(size_type __n,
const _Allocator& __a = _Allocator())
94 vector(size_type __n,
const _Tp& __value,
95 const _Allocator& __a = _Allocator())
96 : _Base(__n, __value, __a)
103 vector(size_type __n,
const _Tp& __value = _Tp(),
104 const _Allocator& __a = _Allocator())
105 : _Base(__n, __value, __a)
112 #if __cplusplus >= 201103L
113 template<
typename _InputIterator,
114 typename = std::_RequireInputIter<_InputIterator>>
116 template<
typename _InputIterator>
118 vector(_InputIterator __first, _InputIterator __last,
119 const _Allocator& __a = _Allocator())
120 : _Base(__first, __last, __a)
126 vector(
const vector& __x)
134 vector(
const _Base& __x)
141 #if __cplusplus >= 201103L
142 vector(vector&& __x) noexcept
143 : _Base(std::move(__x))
149 vector(
const _Base& __x,
const _Allocator& __a)
156 vector(vector&& __x,
const _Allocator& __a) noexcept
157 : _Base(std::move(__x), __a)
163 vector(initializer_list<value_type> __l,
164 const allocator_type& __a = allocator_type())
165 : _Base(__l, __a) { }
168 ~vector() _GLIBCXX_NOEXCEPT
175 operator=(
const vector& __x)
177 static_cast<_Base&
>(*this) = __x;
181 #if __cplusplus >= 201103L
183 operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
187 static_cast<_Base&
>(*this) = std::move(__x);
192 operator=(initializer_list<value_type> __l)
194 static_cast<_Base&
>(*this) = __l;
200 using _Base::get_allocator;
205 begin() _GLIBCXX_NOEXCEPT
206 {
return iterator(_Base::begin(),
this); }
209 begin() const _GLIBCXX_NOEXCEPT
210 {
return const_iterator(_Base::begin(),
this); }
213 end() _GLIBCXX_NOEXCEPT
214 {
return iterator(_Base::end(),
this); }
217 end() const _GLIBCXX_NOEXCEPT
218 {
return const_iterator(_Base::end(),
this); }
221 rbegin() _GLIBCXX_NOEXCEPT
222 {
return reverse_iterator(end()); }
224 const_reverse_iterator
225 rbegin() const _GLIBCXX_NOEXCEPT
226 {
return const_reverse_iterator(end()); }
229 rend() _GLIBCXX_NOEXCEPT
230 {
return reverse_iterator(begin()); }
232 const_reverse_iterator
233 rend() const _GLIBCXX_NOEXCEPT
234 {
return const_reverse_iterator(begin()); }
236 #if __cplusplus >= 201103L
238 cbegin() const noexcept
239 {
return const_iterator(_Base::begin(),
this); }
242 cend() const noexcept
243 {
return const_iterator(_Base::end(),
this); }
245 const_reverse_iterator
246 crbegin() const noexcept
247 {
return const_reverse_iterator(end()); }
249 const_reverse_iterator
250 crend() const noexcept
251 {
return const_reverse_iterator(begin()); }
256 using _Base::max_size;
258 #if __cplusplus >= 201103L
260 resize(size_type __sz)
263 _M_profile_resize(
this, this->capacity(), __sz);
268 resize(size_type __sz,
const _Tp& __c)
271 _M_profile_resize(
this, this->capacity(), __sz);
272 _Base::resize(__sz, __c);
276 resize(size_type __sz, _Tp __c = _Tp())
279 _M_profile_resize(
this, this->capacity(), __sz);
280 _Base::resize(__sz, __c);
284 #if __cplusplus >= 201103L
285 using _Base::shrink_to_fit;
292 operator[](size_type __n)
295 return _M_base()[__n];
298 operator[](size_type __n)
const
301 return _M_base()[__n];
309 return _Base::front();
315 return _Base::front();
321 return _Base::back();
327 return _Base::back();
336 push_back(
const _Tp& __x)
338 size_type __old_size = this->capacity();
339 _Base::push_back(__x);
340 _M_profile_resize(
this, __old_size, this->capacity());
343 #if __cplusplus >= 201103L
347 size_type __old_size = this->capacity();
348 _Base::push_back(std::move(__x));
349 _M_profile_resize(
this, __old_size, this->capacity());
355 insert(iterator __position,
const _Tp& __x)
359 size_type __old_size = this->capacity();
360 typename _Base::iterator __res = _Base::insert(__position.base(), __x);
361 _M_profile_resize(
this, __old_size, this->capacity());
362 return iterator(__res,
this);
365 #if __cplusplus >= 201103L
367 insert(iterator __position, _Tp&& __x)
371 size_type __old_size = this->capacity();
372 typename _Base::iterator __res = _Base::insert(__position.base(), __x);
373 _M_profile_resize(
this, __old_size, this->capacity());
374 return iterator(__res,
this);
377 template<
typename... _Args>
379 emplace(iterator __position, _Args&&... __args)
381 typename _Base::iterator __res
382 = _Base::emplace(__position.base(),
383 std::forward<_Args>(__args)...);
384 return iterator(__res,
this);
388 insert(iterator __position, initializer_list<value_type> __l)
389 { this->insert(__position, __l.begin(), __l.end()); }
392 #if __cplusplus >= 201103L
402 #if __cplusplus >= 201103L
403 noexcept(_Alloc_traits::_S_nothrow_swap())
410 insert(iterator __position, size_type __n,
const _Tp& __x)
414 size_type __old_size = this->capacity();
415 _Base::insert(__position, __n, __x);
416 _M_profile_resize(
this, __old_size, this->capacity());
419 #if __cplusplus >= 201103L
420 template<
typename _InputIterator,
421 typename = std::_RequireInputIter<_InputIterator>>
423 template<
typename _InputIterator>
426 insert(iterator __position,
427 _InputIterator __first, _InputIterator __last)
431 size_type __old_size = this->capacity();
432 _Base::insert(__position, __first, __last);
433 _M_profile_resize(
this, __old_size, this->capacity());
438 erase(iterator __position)
440 typename _Base::iterator __res = _Base::erase(__position.base());
441 return iterator(__res,
this);
445 erase(iterator __first, iterator __last)
449 typename _Base::iterator __res = _Base::erase(__first.base(),
451 return iterator(__res,
this);
455 clear() _GLIBCXX_NOEXCEPT
462 inline void _M_profile_find()
const
467 inline void _M_profile_iterate(
int __rewind = 0)
const
473 void _M_profile_resize(
void* obj, size_type __old_size,
474 size_type __new_size)
476 if (__old_size < __new_size) {
483 template<
typename _Tp,
typename _Alloc>
486 const vector<_Tp, _Alloc>& __rhs)
487 {
return __lhs._M_base() == __rhs._M_base(); }
489 template<
typename _Tp,
typename _Alloc>
492 const vector<_Tp, _Alloc>& __rhs)
493 {
return __lhs._M_base() != __rhs._M_base(); }
495 template<
typename _Tp,
typename _Alloc>
497 operator<(const vector<_Tp, _Alloc>& __lhs,
498 const vector<_Tp, _Alloc>& __rhs)
499 {
return __lhs._M_base() < __rhs._M_base(); }
501 template<
typename _Tp,
typename _Alloc>
503 operator<=(const vector<_Tp, _Alloc>& __lhs,
504 const vector<_Tp, _Alloc>& __rhs)
505 {
return __lhs._M_base() <= __rhs._M_base(); }
507 template<
typename _Tp,
typename _Alloc>
510 const vector<_Tp, _Alloc>& __rhs)
511 {
return __lhs._M_base() >= __rhs._M_base(); }
513 template<
typename _Tp,
typename _Alloc>
515 operator>(
const vector<_Tp, _Alloc>& __lhs,
516 const vector<_Tp, _Alloc>& __rhs)
517 {
return __lhs._M_base() > __rhs._M_base(); }
519 template<
typename _Tp,
typename _Alloc>
521 swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>& __rhs)
522 { __lhs.swap(__rhs); }
524 #if __cplusplus >= 201103L
525 template<
typename _Tp,
typename _Alloc>
527 swap(vector<_Tp, _Alloc>&& __lhs, vector<_Tp, _Alloc>& __rhs)
528 { __lhs.swap(__rhs); }
530 template<
typename _Tp,
typename _Alloc>
532 swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>&& __rhs)
533 { __lhs.swap(__rhs); }
538 #if __cplusplus >= 201103L
541 template<
typename _Alloc>
542 struct hash<__profile::vector<bool, _Alloc>>
543 :
public __hash_base<size_t, __profile::vector<bool, _Alloc>>
546 operator()(
const __profile::vector<bool, _Alloc>& __b)
const noexcept
547 {
return std::hash<_GLIBCXX_STD_C::vector<bool, _Alloc>>()
#define __profcxx_vector_iterate(__x...)
Definition: profiler.h:281
bool operator>=(const _Safe_iterator< _IteratorL, _Sequence > &__lhs, const _Safe_iterator< _IteratorR, _Sequence > &__rhs)
Definition: safe_iterator.h:644
#define __profcxx_vector_find(__x...)
Definition: profiler.h:284
#define __profcxx_vector_construct(__x...)
Definition: profiler.h:235
bool operator==(const exception_ptr &, const exception_ptr &) _GLIBCXX_USE_NOEXCEPT __attribute__((__pure__))
#define __profcxx_vector_resize2(__x...)
Definition: profiler.h:283
#define __profcxx_vector_construct2(__x...)
Definition: profiler.h:279
#define __profcxx_vector_resize(__x...)
Definition: profiler.h:233
bool operator>(const _Safe_iterator< _IteratorL, _Sequence > &__lhs, const _Safe_iterator< _IteratorR, _Sequence > &__rhs)
Definition: safe_iterator.h:612
#define __profcxx_vector_destruct(__x...)
Definition: profiler.h:234
bool operator!=(const exception_ptr &, const exception_ptr &) _GLIBCXX_USE_NOEXCEPT __attribute__((__pure__))
#define __profcxx_vector_destruct2(__x...)
Definition: profiler.h:278
#define __profcxx_vector_invalid_operator(__x...)
Definition: profiler.h:282
#define __profcxx_vector_insert(__x...)
Definition: profiler.h:280
void swap(exception_ptr &__lhs, exception_ptr &__rhs)
Definition: exception_ptr.h:160