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

◆ _M_push_front_aux()

template<typename _Tp, typename _Alloc>
template<typename... _Args>
void deque::_M_push_front_aux ( _Args &&... __args)
protected

Helper functions for push_* and pop_*.

Definition at line 523 of file deque.tcc.

530 {
531 if (size() == max_size())
533 __N("cannot create std::deque larger than max_size()"));
534
536 *(this->_M_impl._M_start._M_node - 1) = this->_M_allocate_node();
537 __try
538 {
539 this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node
540 - 1);
541 this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_last - 1;
542#if __cplusplus >= 201103L
544 this->_M_impl._M_start._M_cur,
546#else
547 this->_M_impl.construct(this->_M_impl._M_start._M_cur, __t);
548#endif
549 }
550 __catch(...)
551 {
552 ++this->_M_impl._M_start;
553 _M_deallocate_node(*(this->_M_impl._M_start._M_node - 1));
555 }
556 }
#define __catch(X)
#define __N(msgid)
void __throw_length_error(const char *)
_Ptr _M_allocate_node()
Definition stl_deque.h:583
void _M_deallocate_node(_Ptr __p) noexcept
Definition stl_deque.h:590
size_type size() const noexcept
Definition stl_deque.h:1330
size_type max_size() const noexcept
Definition stl_deque.h:1341
_Deque_impl _M_impl
Definition stl_deque.h:616
void _M_reserve_map_at_front(size_type __nodes_to_add=1)
Memory-handling helpers for the major map.
Definition stl_deque.h:2318
A standard container using fixed-size memory allocation and constant-time manipulation of elements at...
Definition stl_deque.h:792
static constexpr std::__enable_if_t< __is_custom_pointer< _Ptr >::value > construct(_Tp_alloc_type &__a, _Ptr __p, _Args &&... __args) noexcept(noexcept(_Base_type::construct(__a, std::__to_address(__p), std::forward< _Args >(__args)...)))

References deque(), __catch, __N, __throw_exception_again, std::__throw_length_error(), __try, _M_allocate_node(), _M_deallocate_node(), _M_impl, _M_reserve_map_at_front(), __gnu_cxx::__alloc_traits< _Tp_alloc_type >::construct(), std::forward(), max_size(), and size().

Referenced by emplace_front().

Here is the call graph for this function:
Here is the caller graph for this function: