STD::_DEQUE_BASE(3cxx)
π NAME π
okay so bestie, today's main character is std::_Deque_base< _Tp, _Alloc > β yes, that's the whole name, and yes, it's giving template royalty. This is the 3cxx manual page for it, and we're going through every protected type, function, attribute, and tiny detail together. no skips. periodt. π
β¨
β¨ SYNOPSIS β¨
#include <deque>
It's inherited by std::deque< _StateSeqT > [protected], and std::deque< _Tp, _Alloc > [protected]. π«Ά
π‘οΈ Protected Types π‘οΈ
enum { _S_initial_map_size }β the enum, exactly as written, no extra lore added by me.typedef __gnu_cxx::__alloc_traits< _Tp_alloc_type > _Alloc_traitsβ the_Alloc_traitstypedef, slaying in its natural habitat.typedef __gnu_cxx::__alloc_traits< _Map_alloc_type > _Map_alloc_traitsβ the_Map_alloc_traitstypedef. iconic name, zero notes.typedef _Alloc_traits::template rebind< _Ptr >::other _Map_alloc_typeβ the_Map_alloc_typetypedef, keeping the template syntax fully intact.typedef iterator::_Map_pointer _Map_pointerβ the_Map_pointertypedef.typedef _Alloc_traits::pointer _Ptrβ the_Ptrtypedef.typedef _Alloc_traits::const_pointer _Ptr_constβ the_Ptr_consttypedef.typedef __gnu_cxx::__alloc_traits< _Alloc >::template rebind< _Tp >::other _Tp_alloc_typeβ the_Tp_alloc_typetypedef, with the_Tpand>::otherall accounted for.typedef _Alloc allocator_typeβ theallocator_typetypedef.typedef _Deque_iterator< _Tp, const _Tp &, _Ptr_const > const_iteratorβ theconst_iteratortypedef.typedef _Deque_iterator< _Tp, _Tp &, _Ptr > iteratorβ theiteratortypedef.
π§ Protected Member Functions π§
_Deque_base (_Deque_base &&__x)β one of the protected constructors, exactly this signature._Deque_base (_Deque_base &&__x, const allocator_type &__a)β protected constructor with the allocator parameter._Deque_base (_Deque_base &&__x, const allocator_type &__a, size_t __n)β protected constructor with the allocator andsize_t __n._Deque_base (const allocator_type &__a)β protected constructor takingconst allocator_type &__a._Deque_base (const allocator_type &__a, size_t __num_elements)β protected constructor with allocator andsize_t __num_elements._Deque_base (size_t __num_elements)β protected constructor takingsize_t __num_elements._Map_pointer _M_allocate_map (size_t __n)β protected member function,_Map_pointerreturn type,size_t __nparameter._Ptr _M_allocate_node ()β protected member function returning_Ptr, no parameters.void _M_create_nodes (_Map_pointer __nstart, _Map_pointer __nfinish)β protected member function taking__nstartand__nfinish.void _M_deallocate_map (_Map_pointer __p, size_t __n) noexceptβ protected,noexcept, takes__pand__n.void _M_deallocate_node (_Ptr __p) noexceptβ protected,noexcept, takes_Ptr __p.void _M_destroy_nodes (_Map_pointer __nstart, _Map_pointer __nfinish) noexceptβ protected,noexcept, takes__nstartand__nfinish._Map_alloc_type _M_get_map_allocator () const noexceptβ protected,const noexcept, returns_Map_alloc_type.const _Tp_alloc_type & _M_get_Tp_allocator () const noexceptβ protectedconst noexceptoverload returningconst _Tp_alloc_type &._Tp_alloc_type & _M_get_Tp_allocator () noexceptβ protectednoexceptoverload returning_Tp_alloc_type &.void _M_initialize_map (size_t)β Layout storage.allocator_type get_allocator () const noexceptβ protected member function,const noexcept, returnsallocator_type.
πΈ Protected Attributes πΈ
_Deque_impl _M_implβ the protected attribute. that's it, that's the whole list, and she's serving exactly one member.
π« Detailed Description π«
template<typename _Tp, typename _Alloc>
class std::_Deque_base< _Tp, _Alloc >
The original page has a stray " glued right before βDeque base class.β β so if you spot it in your copy, that's not you, bestie. We're keeping the detail, not fixing it. π
Deque base class. This class provides the unified face for deque's allocation. This class's constructor and destructor allocate and deallocate (but do not initialize) storage. This makes exception safety easier.
Nothing in this class ever constructs or destroys an actual Tp element. (Deque handles that itself.) Only/All memory management is performed here.
π Member Function Documentation π
template<typename _Tp , typename _Alloc > void std::_Deque_base< _Tp, _Alloc >::_M_initialize_map (size_t __num_elements) [protected]
Layout storage.
π§Ύ Parameters
__num_elementsβ The count of T's for which to allocate space at first.
π Returns
- Nothing. β literally nothing, bestie.
The initial underlying memory layout is a bit complicated...
References std::max().
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
Cute little sign-off from the footer: this page is from libstdc++ and it's tagged as a 3cxx manual page. There's no date printed in the footer, so I'm not inventing one β we keep the facts exact and the vibes immaculate. πβ¨π¦
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms