52 deque<_Tp, _Allocator>, _Allocator,
53 __gnu_debug::_Safe_sequence>,
54 public _GLIBCXX_STD_C::deque<_Tp, _Allocator>
56 typedef _GLIBCXX_STD_C::deque<_Tp, _Allocator>
_Base;
64 template<
typename _ItT,
typename _SeqT,
typename _CatT>
65 friend class ::__gnu_debug::_Safe_iterator;
72 _Base_ref(
const _Base& __r) : _M_ref(__r) { }
78 typedef typename _Base::reference reference;
79 typedef typename _Base::const_reference const_reference;
86 typedef typename _Base::size_type size_type;
87 typedef typename _Base::difference_type difference_type;
89 typedef _Tp value_type;
90 typedef _Allocator allocator_type;
91 typedef typename _Base::pointer pointer;
92 typedef typename _Base::const_pointer const_pointer;
98#if __cplusplus < 201103L
111 deque(
const deque& __d,
const __type_identity_t<_Allocator>& __a)
112 :
_Base(__d, __a) { }
114 deque(
deque&& __d,
const __type_identity_t<_Allocator>& __a)
118 const allocator_type& __a = allocator_type())
119 :
_Base(__l, __a) { }
125 deque(
const _Allocator& __a)
128#if __cplusplus >= 201103L
130 deque(size_type __n,
const _Allocator& __a = _Allocator())
131 :
_Base(__n, __a) { }
133 deque(size_type __n,
const __type_identity_t<_Tp>& __value,
134 const _Allocator& __a = _Allocator())
135 :
_Base(__n, __value, __a) { }
138 deque(size_type __n,
const _Tp& __value = _Tp(),
139 const _Allocator& __a = _Allocator())
140 :
_Base(__n, __value, __a) { }
143#if __cplusplus >= 201103L
144 template<
class _InputIterator,
145 typename = std::_RequireInputIter<_InputIterator>>
147 template<
class _InputIterator>
149 deque(_InputIterator __first, _InputIterator __last,
150 const _Allocator& __a = _Allocator())
152 __glibcxx_check_valid_constructor_range(__first, __last)),
157 :
_Base(__x._M_ref) { }
159#if __cplusplus >= 201103L
161 operator=(
const deque&) =
default;
164 operator=(
deque&&) =
default;
169 _Base::operator=(__l);
170 this->_M_invalidate_all();
175#if __cplusplus >= 201103L
176 template<
class _InputIterator,
177 typename = std::_RequireInputIter<_InputIterator>>
179 template<
class _InputIterator>
182 assign(_InputIterator __first, _InputIterator __last)
185 __glibcxx_check_valid_range2(__first, __last, __dist);
186 if (__dist.
second >= __gnu_debug::__dp_sign)
187 _Base::assign(__gnu_debug::__unsafe(__first),
188 __gnu_debug::__unsafe(__last));
190 _Base::assign(__first, __last);
192 this->_M_invalidate_all();
196 assign(size_type __n,
const _Tp& __t)
198 _Base::assign(__n, __t);
199 this->_M_invalidate_all();
202#if __cplusplus >= 201103L
207 this->_M_invalidate_all();
211 using _Base::get_allocator;
216 begin() _GLIBCXX_NOEXCEPT
217 {
return iterator(_Base::begin(),
this); }
221 begin()
const _GLIBCXX_NOEXCEPT
226 end() _GLIBCXX_NOEXCEPT
227 {
return iterator(_Base::end(),
this); }
231 end()
const _GLIBCXX_NOEXCEPT
236 rbegin() _GLIBCXX_NOEXCEPT
241 rbegin()
const _GLIBCXX_NOEXCEPT
246 rend() _GLIBCXX_NOEXCEPT
251 rend()
const _GLIBCXX_NOEXCEPT
254#if __cplusplus >= 201103L
257 cbegin()
const noexcept
262 cend()
const noexcept
267 crbegin()
const noexcept
272 crend()
const noexcept
278 _M_invalidate_after_nth(difference_type __n)
281 this->_M_invalidate_if(_After_nth(__n, _Base::begin()));
287 using _Base::max_size;
289#if __cplusplus >= 201103L
291 resize(size_type __sz)
293 bool __invalidate_all = __sz > this->
size();
294 if (__sz < this->
size())
295 this->_M_invalidate_after_nth(__sz);
299 if (__invalidate_all)
300 this->_M_invalidate_all();
304 resize(size_type __sz,
const _Tp& __c)
306 bool __invalidate_all = __sz > this->
size();
307 if (__sz < this->
size())
308 this->_M_invalidate_after_nth(__sz);
310 _Base::resize(__sz, __c);
312 if (__invalidate_all)
313 this->_M_invalidate_all();
317 resize(size_type __sz, _Tp __c = _Tp())
319 bool __invalidate_all = __sz > this->
size();
320 if (__sz < this->
size())
321 this->_M_invalidate_after_nth(__sz);
323 _Base::resize(__sz, __c);
325 if (__invalidate_all)
326 this->_M_invalidate_all();
330#if __cplusplus >= 201103L
332 shrink_to_fit()
noexcept
334 if (_Base::_M_shrink_to_fit())
335 this->_M_invalidate_all();
344 operator[](size_type __n) _GLIBCXX_NOEXCEPT
346 __glibcxx_check_subscript(__n);
347 return _Base::operator[](__n);
352 operator[](size_type __n)
const _GLIBCXX_NOEXCEPT
354 __glibcxx_check_subscript(__n);
355 return _Base::operator[](__n);
362 front() _GLIBCXX_NOEXCEPT
364 __glibcxx_check_nonempty();
365 return _Base::front();
370 front()
const _GLIBCXX_NOEXCEPT
372 __glibcxx_check_nonempty();
373 return _Base::front();
378 back() _GLIBCXX_NOEXCEPT
380 __glibcxx_check_nonempty();
381 return _Base::back();
386 back()
const _GLIBCXX_NOEXCEPT
388 __glibcxx_check_nonempty();
389 return _Base::back();
394 push_front(
const _Tp& __x)
396 _Base::push_front(__x);
397 this->_M_invalidate_all();
401 push_back(
const _Tp& __x)
403 _Base::push_back(__x);
404 this->_M_invalidate_all();
407#if __cplusplus >= 201103L
409 push_front(_Tp&& __x)
416 template<
typename... _Args>
417#if __cplusplus > 201402L
422 emplace_front(_Args&&... __args)
424 _Base::emplace_front(std::forward<_Args>(__args)...);
425 this->_M_invalidate_all();
426#if __cplusplus > 201402L
431 template<
typename... _Args>
432#if __cplusplus > 201402L
437 emplace_back(_Args&&... __args)
439 _Base::emplace_back(std::forward<_Args>(__args)...);
440 this->_M_invalidate_all();
441#if __cplusplus > 201402L
446 template<
typename... _Args>
452 std::forward<_Args>(__args)...);
453 this->_M_invalidate_all();
459#if __cplusplus >= 201103L
462 insert(
iterator __position,
const _Tp& __x)
467 this->_M_invalidate_all();
471#if __cplusplus >= 201103L
474 {
return emplace(__position,
std::move(__x)); }
481 this->_M_invalidate_all();
486#if __cplusplus >= 201103L
492 this->_M_invalidate_all();
497 insert(
iterator __position, size_type __n,
const _Tp& __x)
500 _Base::insert(__position.
base(), __n, __x);
501 this->_M_invalidate_all();
505#if __cplusplus >= 201103L
506 template<
class _InputIterator,
507 typename = std::_RequireInputIter<_InputIterator>>
510 _InputIterator __first, _InputIterator __last)
515 if (__dist.
second >= __gnu_debug::__dp_sign)
516 __res = _Base::insert(__position.
base(),
517 __gnu_debug::__unsafe(__first),
518 __gnu_debug::__unsafe(__last));
520 __res = _Base::insert(__position.
base(), __first, __last);
522 this->_M_invalidate_all();
526 template<
class _InputIterator>
529 _InputIterator __first, _InputIterator __last)
534 if (__dist.
second >= __gnu_debug::__dp_sign)
535 _Base::insert(__position.
base(),
536 __gnu_debug::__unsafe(__first),
537 __gnu_debug::__unsafe(__last));
539 _Base::insert(__position.
base(), __first, __last);
541 this->_M_invalidate_all();
546 pop_front() _GLIBCXX_NOEXCEPT
548 __glibcxx_check_nonempty();
549 this->_M_invalidate_if(
_Equal(_Base::begin()));
554 pop_back() _GLIBCXX_NOEXCEPT
556 __glibcxx_check_nonempty();
557 this->_M_invalidate_if(
_Equal(--_Base::end()));
562#if __cplusplus >= 201103L
569#if __cplusplus >= 201103L
574 if (__victim == _Base::begin() || __victim == _Base::end() - 1)
576 this->_M_invalidate_if(
_Equal(__victim));
577 return iterator(_Base::erase(__victim),
this);
582 this->_M_invalidate_all();
588#if __cplusplus >= 201103L
598 if (__first.base() == __last.base())
599#if __cplusplus >= 201103L
600 return iterator(__first.base()._M_const_cast(),
this);
604 else if (__first.base() == _Base::begin()
605 || __last.base() == _Base::end())
607 this->_M_detach_singular();
609 __position != __last.
base(); ++__position)
611 this->_M_invalidate_if(
_Equal(__position));
615 return iterator(_Base::erase(__first.base(), __last.base()),
620 this->_M_revalidate_singular();
621 __throw_exception_again;
628 this->_M_invalidate_all();
635 _GLIBCXX_NOEXCEPT_IF(
noexcept(declval<_Base&>().swap(__x)) )
642 clear() _GLIBCXX_NOEXCEPT
645 this->_M_invalidate_all();
649 _M_base() _GLIBCXX_NOEXCEPT {
return *
this; }
652 _M_base()
const _GLIBCXX_NOEXCEPT {
return *
this; }