54 deque<_Tp, _Allocator>, _Allocator,
55 __gnu_debug::_Safe_sequence>,
56 public _GLIBCXX_STD_C::deque<_Tp, _Allocator>
58 typedef _GLIBCXX_STD_C::deque<_Tp, _Allocator>
_Base;
66 template<
typename _ItT,
typename _SeqT,
typename _CatT>
67 friend class ::__gnu_debug::_Safe_iterator;
74 _Base_ref(
const _Base& __r) : _M_ref(__r) { }
80 typedef typename _Base::reference reference;
81 typedef typename _Base::const_reference const_reference;
88 typedef typename _Base::size_type size_type;
89 typedef typename _Base::difference_type difference_type;
91 typedef _Tp value_type;
92 typedef _Allocator allocator_type;
93 typedef typename _Base::pointer pointer;
94 typedef typename _Base::const_pointer const_pointer;
100#if __cplusplus < 201103L
113 deque(
const deque& __d,
const __type_identity_t<_Allocator>& __a)
114 :
_Base(__d, __a) { }
116 deque(
deque&& __d,
const __type_identity_t<_Allocator>& __a)
120 const allocator_type& __a = allocator_type())
121 :
_Base(__l, __a) { }
127 deque(
const _Allocator& __a)
130#if __cplusplus >= 201103L
132 deque(size_type __n,
const _Allocator& __a = _Allocator())
133 :
_Base(__n, __a) { }
135 deque(size_type __n,
const __type_identity_t<_Tp>& __value,
136 const _Allocator& __a = _Allocator())
137 :
_Base(__n, __value, __a) { }
140 deque(size_type __n,
const _Tp& __value = _Tp(),
141 const _Allocator& __a = _Allocator())
142 :
_Base(__n, __value, __a) { }
145#if __cplusplus >= 201103L
146 template<
class _InputIterator,
147 typename = std::_RequireInputIter<_InputIterator>>
149 template<
class _InputIterator>
151 deque(_InputIterator __first, _InputIterator __last,
152 const _Allocator& __a = _Allocator())
154 __glibcxx_check_valid_constructor_range(__first, __last)),
159 :
_Base(__x._M_ref) { }
161#if __cplusplus >= 201103L
163 operator=(
const deque&) =
default;
166 operator=(
deque&&) =
default;
171 _Base::operator=(__l);
172 this->_M_invalidate_all();
177#if __cplusplus >= 201103L
178 template<
class _InputIterator,
179 typename = std::_RequireInputIter<_InputIterator>>
181 template<
class _InputIterator>
184 assign(_InputIterator __first, _InputIterator __last)
187 __glibcxx_check_valid_range2(__first, __last, __dist);
188 if (__dist.
second >= __gnu_debug::__dp_sign)
189 _Base::assign(__gnu_debug::__unsafe(__first),
190 __gnu_debug::__unsafe(__last));
192 _Base::assign(__first, __last);
194 this->_M_invalidate_all();
198 assign(size_type __n,
const _Tp& __t)
200 _Base::assign(__n, __t);
201 this->_M_invalidate_all();
204#if __cplusplus >= 201103L
209 this->_M_invalidate_all();
213 using _Base::get_allocator;
218 begin() _GLIBCXX_NOEXCEPT
219 {
return iterator(_Base::begin(),
this); }
223 begin()
const _GLIBCXX_NOEXCEPT
228 end() _GLIBCXX_NOEXCEPT
229 {
return iterator(_Base::end(),
this); }
233 end()
const _GLIBCXX_NOEXCEPT
238 rbegin() _GLIBCXX_NOEXCEPT
243 rbegin()
const _GLIBCXX_NOEXCEPT
248 rend() _GLIBCXX_NOEXCEPT
253 rend()
const _GLIBCXX_NOEXCEPT
256#if __cplusplus >= 201103L
259 cbegin()
const noexcept
264 cend()
const noexcept
269 crbegin()
const noexcept
274 crend()
const noexcept
280 _M_invalidate_after_nth(difference_type __n)
283 this->_M_invalidate_if(_After_nth(__n, _Base::begin()));
289 using _Base::max_size;
291#if __cplusplus >= 201103L
293 resize(size_type __sz)
295 bool __invalidate_all = __sz > this->
size();
296 if (__sz < this->
size())
297 this->_M_invalidate_after_nth(__sz);
301 if (__invalidate_all)
302 this->_M_invalidate_all();
306 resize(size_type __sz,
const _Tp& __c)
308 bool __invalidate_all = __sz > this->
size();
309 if (__sz < this->
size())
310 this->_M_invalidate_after_nth(__sz);
312 _Base::resize(__sz, __c);
314 if (__invalidate_all)
315 this->_M_invalidate_all();
319 resize(size_type __sz, _Tp __c = _Tp())
321 bool __invalidate_all = __sz > this->
size();
322 if (__sz < this->
size())
323 this->_M_invalidate_after_nth(__sz);
325 _Base::resize(__sz, __c);
327 if (__invalidate_all)
328 this->_M_invalidate_all();
332#if __cplusplus >= 201103L
334 shrink_to_fit()
noexcept
336 if (_Base::_M_shrink_to_fit())
337 this->_M_invalidate_all();
346 operator[](size_type __n) _GLIBCXX_NOEXCEPT
348 __glibcxx_check_subscript(__n);
349 return _Base::operator[](__n);
354 operator[](size_type __n)
const _GLIBCXX_NOEXCEPT
356 __glibcxx_check_subscript(__n);
357 return _Base::operator[](__n);
364 front() _GLIBCXX_NOEXCEPT
366 __glibcxx_check_nonempty();
367 return _Base::front();
372 front()
const _GLIBCXX_NOEXCEPT
374 __glibcxx_check_nonempty();
375 return _Base::front();
380 back() _GLIBCXX_NOEXCEPT
382 __glibcxx_check_nonempty();
383 return _Base::back();
388 back()
const _GLIBCXX_NOEXCEPT
390 __glibcxx_check_nonempty();
391 return _Base::back();
396 push_front(
const _Tp& __x)
398 _Base::push_front(__x);
399 this->_M_invalidate_all();
403 push_back(
const _Tp& __x)
405 _Base::push_back(__x);
406 this->_M_invalidate_all();
409#if __cplusplus >= 201103L
411 push_front(_Tp&& __x)
418 template<
typename... _Args>
419#if __cplusplus > 201402L
424 emplace_front(_Args&&... __args)
426 _Base::emplace_front(std::forward<_Args>(__args)...);
427 this->_M_invalidate_all();
428#if __cplusplus > 201402L
433 template<
typename... _Args>
434#if __cplusplus > 201402L
439 emplace_back(_Args&&... __args)
441 _Base::emplace_back(std::forward<_Args>(__args)...);
442 this->_M_invalidate_all();
443#if __cplusplus > 201402L
448 template<
typename... _Args>
454 std::forward<_Args>(__args)...);
455 this->_M_invalidate_all();
461#if __cplusplus >= 201103L
464 insert(
iterator __position,
const _Tp& __x)
469 this->_M_invalidate_all();
473#if __cplusplus >= 201103L
476 {
return emplace(__position,
std::move(__x)); }
483 this->_M_invalidate_all();
488#if __cplusplus >= 201103L
494 this->_M_invalidate_all();
499 insert(
iterator __position, size_type __n,
const _Tp& __x)
502 _Base::insert(__position.
base(), __n, __x);
503 this->_M_invalidate_all();
507#if __cplusplus >= 201103L
508 template<
class _InputIterator,
509 typename = std::_RequireInputIter<_InputIterator>>
512 _InputIterator __first, _InputIterator __last)
517 if (__dist.
second >= __gnu_debug::__dp_sign)
518 __res = _Base::insert(__position.
base(),
519 __gnu_debug::__unsafe(__first),
520 __gnu_debug::__unsafe(__last));
522 __res = _Base::insert(__position.
base(), __first, __last);
524 this->_M_invalidate_all();
528 template<
class _InputIterator>
531 _InputIterator __first, _InputIterator __last)
536 if (__dist.
second >= __gnu_debug::__dp_sign)
537 _Base::insert(__position.
base(),
538 __gnu_debug::__unsafe(__first),
539 __gnu_debug::__unsafe(__last));
541 _Base::insert(__position.
base(), __first, __last);
543 this->_M_invalidate_all();
548 pop_front() _GLIBCXX_NOEXCEPT
550 __glibcxx_check_nonempty();
551 this->_M_invalidate_if(
_Equal(_Base::begin()));
556 pop_back() _GLIBCXX_NOEXCEPT
558 __glibcxx_check_nonempty();
559 this->_M_invalidate_if(
_Equal(--_Base::end()));
564#if __cplusplus >= 201103L
571#if __cplusplus >= 201103L
576 if (__victim == _Base::begin() || __victim == _Base::end() - 1)
578 this->_M_invalidate_if(
_Equal(__victim));
579 return iterator(_Base::erase(__victim),
this);
584 this->_M_invalidate_all();
590#if __cplusplus >= 201103L
600 if (__first.base() == __last.base())
601#if __cplusplus >= 201103L
602 return iterator(__first.base()._M_const_cast(),
this);
606 else if (__first.base() == _Base::begin()
607 || __last.base() == _Base::end())
609 this->_M_detach_singular();
611 __position != __last.
base(); ++__position)
613 this->_M_invalidate_if(
_Equal(__position));
617 return iterator(_Base::erase(__first.base(), __last.base()),
622 this->_M_revalidate_singular();
623 __throw_exception_again;
630 this->_M_invalidate_all();
637 _GLIBCXX_NOEXCEPT_IF(
noexcept(declval<_Base&>().swap(__x)) )
644 clear() _GLIBCXX_NOEXCEPT
647 this->_M_invalidate_all();
651 _M_base() _GLIBCXX_NOEXCEPT {
return *
this; }
654 _M_base()
const _GLIBCXX_NOEXCEPT {
return *
this; }