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_traits typedef, slaying in its natural habitat.
  • typedef __gnu_cxx::__alloc_traits< _Map_alloc_type > _Map_alloc_traits β€” the _Map_alloc_traits typedef. iconic name, zero notes.
  • typedef _Alloc_traits::template rebind< _Ptr >::other _Map_alloc_type β€” the _Map_alloc_type typedef, keeping the template syntax fully intact.
  • typedef iterator::_Map_pointer _Map_pointer β€” the _Map_pointer typedef.
  • typedef _Alloc_traits::pointer _Ptr β€” the _Ptr typedef.
  • typedef _Alloc_traits::const_pointer _Ptr_const β€” the _Ptr_const typedef.
  • typedef __gnu_cxx::__alloc_traits< _Alloc >::template rebind< _Tp >::other _Tp_alloc_type β€” the _Tp_alloc_type typedef, with the _Tp and >::other all accounted for.
  • typedef _Alloc allocator_type β€” the allocator_type typedef.
  • typedef _Deque_iterator< _Tp, const _Tp &, _Ptr_const > const_iterator β€” the const_iterator typedef.
  • typedef _Deque_iterator< _Tp, _Tp &, _Ptr > iterator β€” the iterator typedef.

🧚 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 and size_t __n.
  • _Deque_base (const allocator_type &__a) β€” protected constructor taking const allocator_type &__a.
  • _Deque_base (const allocator_type &__a, size_t __num_elements) β€” protected constructor with allocator and size_t __num_elements.
  • _Deque_base (size_t __num_elements) β€” protected constructor taking size_t __num_elements.
  • _Map_pointer _M_allocate_map (size_t __n) β€” protected member function, _Map_pointer return type, size_t __n parameter.
  • _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 __nstart and __nfinish.
  • void _M_deallocate_map (_Map_pointer __p, size_t __n) noexcept β€” protected, noexcept, takes __p and __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 __nstart and __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 β€” protected const noexcept overload returning const _Tp_alloc_type &.
  • _Tp_alloc_type & _M_get_Tp_allocator () noexcept β€” protected noexcept overload returning _Tp_alloc_type &.
  • void _M_initialize_map (size_t) β€” Layout storage.
  • allocator_type get_allocator () const noexcept β€” protected member function, const noexcept, returns allocator_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