libstdc++
GNU C++ library
Loading...
Searching...
No Matches

◆ _M_insert_aux() [1/3]

template<typename _Tp, typename _Alloc>
template<typename _ForwardIterator>
void deque::_M_insert_aux ( iterator __pos,
_ForwardIterator __first,
_ForwardIterator __last,
size_type __n )
protected

Definition at line 797 of file deque.tcc.

801 {
802 const difference_type __elemsbefore = __pos - this->_M_impl._M_start;
803 const size_type __length = size();
804 if (static_cast<size_type>(__elemsbefore) < __length / 2)
805 {
807 iterator __old_start = this->_M_impl._M_start;
808 __pos = this->_M_impl._M_start + __elemsbefore;
809 __try
810 {
812 {
813 iterator __start_n = (this->_M_impl._M_start
818 this->_M_impl._M_start = __new_start;
821 }
822 else
823 {
830 this->_M_impl._M_start = __new_start;
832 }
833 }
834 __catch(...)
835 {
839 }
840 }
841 else
842 {
844 iterator __old_finish = this->_M_impl._M_finish;
847 __pos = this->_M_impl._M_finish - __elemsafter;
848 __try
849 {
851 {
852 iterator __finish_n = (this->_M_impl._M_finish
855 this->_M_impl._M_finish,
858 this->_M_impl._M_finish = __new_finish;
861 }
862 else
863 {
867 this->_M_impl._M_finish,
870 this->_M_impl._M_finish = __new_finish;
872 }
873 }
874 __catch(...)
875 {
876 _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
877 __new_finish._M_node + 1);
879 }
880 }
881 }
#define _GLIBCXX_MOVE3(_Tp, _Up, _Vp)
#define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp)
#define __catch(X)
::_Deque_iterator< _OTp, _OTp &, _OTp * > __uninitialized_move_a(::_Deque_iterator< _ITp, _IRef, _IPtr > __first, ::_Deque_iterator< _ITp, _IRef, _IPtr > __last, ::_Deque_iterator< _OTp, _OTp &, _OTp * > __result, allocator< _Tp > &)
Definition deque.tcc:1612
constexpr _OIter copy(_IIter, _IIter, _OIter)
constexpr void advance(_InputIterator &__i, _Distance __n)
A generalization of pointer arithmetic.
_Map_pointer _M_node
Definition stl_deque.h:148
size_type size() const noexcept
Definition stl_deque.h:1330
iterator _M_reserve_elements_at_front(size_type __n)
Memory-handling helpers for the previous internal insert functions.
Definition stl_deque.h:2274
ptrdiff_t difference_type
Definition stl_deque.h:827
_Deque_impl _M_impl
Definition stl_deque.h:616
size_t size_type
Definition stl_deque.h:826
_Tp_alloc_type & _M_get_Tp_allocator() noexcept
Definition stl_deque.h:571
void _M_destroy_nodes(_Map_pointer __nstart, _Map_pointer __nfinish) noexcept
Definition stl_deque.h:699
iterator _M_reserve_elements_at_back(size_type __n)
Memory-handling helpers for the previous internal insert functions.
Definition stl_deque.h:2284
_Base::iterator iterator
Definition stl_deque.h:822
A standard container using fixed-size memory allocation and constant-time manipulation of elements at...
Definition stl_deque.h:792

References deque(), __catch, __throw_exception_again, __try, std::__uninitialized_move_a(), _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, _M_destroy_nodes(), _M_get_Tp_allocator(), _M_impl, std::_Deque_iterator< _Tp, _Ref, _Ptr >::_M_node, _M_reserve_elements_at_back(), _M_reserve_elements_at_front(), std::advance(), std::copy(), and size().

Here is the call graph for this function: