STD::_LIST_BASE(3)

πŸ’– std::_List_base< _Tp, _Alloc > πŸ’–

okay bestie, welcome to the Library Functions Manual, section 3 β€” this is the page for std::_List_base< _Tp, _Alloc >, and yes it's a real one, and yes it's basically the secret scaffolding behind your fave std::list. πŸŽ€ let's get into it ✨


🌸 NAME 🌸

std::_List_base< _Tp, _Alloc > β€” literally, for the actual explanation, go read bits/stl_deque.h's _Deque_base. that's it. that's the name section. iykyk πŸ’…


✨ SYNOPSIS ✨

#include <list>

and the plot twist: it's inherited (as [protected], so lowkey private-ish vibes) by:

  • std::list< _Tp, polymorphic_allocator< _Tp > > [protected]
  • std::list< __inp, __rebind_inp > [protected]
  • std::list< _Tp, _Alloc > [protected]

πŸ‘‘ Public Types

  • typedef _Alloc allocator_type β€” the allocator type, the moment.

🌈 Public Member Functions

  • _List_base (_List_base &&)=default β€” the move constructor, defaulted, iconic.
  • _List_base (_List_base &&__x, _Node_alloc_type &&__a) β€” move + an allocator, bestie edition.
  • _List_base (_Node_alloc_type &&__a) β€” just an allocator, no notes.
  • _List_base (_Node_alloc_type &&__a, _List_base &&__x) β€” allocator first, moved-from base second. order matters, don't be chaotic.
  • _List_base (const _Node_alloc_type &__a) noexcept β€” a const allocator ref, and yes it's noexcept, we love a promise. 🫢
  • void _M_clear () noexcept β€” clear it all out, noexcept, no drama.
  • size_t _M_distance (const __detail::_List_node_base *__first, const __detail::_List_node_base *__last) const β€” distance between two __detail::_List_node_base pointers, const-correct and proud.
  • const _Node_alloc_type & _M_get_Node_allocator () const noexcept β€” hand over the node allocator (const flavor), noexcept.
  • _Node_alloc_type & _M_get_Node_allocator () noexcept β€” same but non-const, also noexcept.
  • void _M_init () noexcept β€” set it up, noexcept.
  • void _M_move_nodes (_List_base &&__x) β€” steal those nodes, respectfully.
  • size_t _M_node_count () const β€” how many nodes we got, const.

⭐ Static Public Member Functions

  • static size_t _S_distance (const __detail::_List_node_base *__first, const __detail::_List_node_base *__last) β€” the static version of distance. same pointers, no this, main character energy.

🧚 Protected Types

  • typedef __gnu_cxx::__alloc_traits< _Node_alloc_type > _Node_alloc_traits
  • typedef _Tp_alloc_traits::template rebind< typename_Node_traits::_Node >::other _Node_alloc_type
  • using _Node_ptr
  • typedef __list::_Node_traits< _Tp, typename _Tp_alloc_traits::pointer > _Node_traits
  • typedef __gnu_cxx::__alloc_traits< _Tp_alloc_type > _Tp_alloc_traits
  • typedef __gnu_cxx::__alloc_traits< _Alloc >::template rebind< _Tp >::other _Tp_alloc_type

that's the whole rebind-and-traits web, periodt. πŸ•ΈοΈβœ¨

πŸ’œ Protected Member Functions

  • void _M_dec_size (size_t __n) β€” decrement the size by __n.
  • void _M_destroy_node (_Node_ptr __p) β€” destroy that node, __p.
  • _Node_alloc_traits::pointer _M_get_node () β€” grab a node, returns a _Node_alloc_traits::pointer.
  • size_t _M_get_size () const β€” read the size, const.
  • void _M_inc_size (size_t __n) β€” increment the size by __n.
  • void _M_put_node (_Node_ptr __p) noexcept β€” put that node back, noexcept.
  • void _M_set_size (size_t __n) β€” hard-set the size to __n.

πŸ¦‹ Protected Attributes

  • _List_impl _M_impl β€” the one and only impl member. she's protected, she's holding everything together. πŸ’…

πŸ“ Detailed Description πŸ“

template<typename _Tp, typename _Alloc>
class std::_List_base< _Tp, _Alloc >"See bits/stl_deque.h's _Deque_base for an explanation.

okay so β€” and i need you to stay calm β€” that stray " right before See is genuinely in there. not me fixing it. it's giving "the source generator had one job" 😭 we simply report the facts, fr fr. and the fact is: go read bits/stl_deque.h's _Deque_base for an explanation. that's the whole detailed description. she said read the other file. iconic, honestly.

⚠️ heads up bestie: this page does not explain the class itself β€” it explicitly points you at bits/stl_deque.h's _Deque_base for that. don't come for me, i'm just the messenger. 🫢

🌟 Author 🌟

Generated automatically by Doxygen for libstdc++ from the source code. so no human to thank, just vibes and a generator. πŸ’€


and that's the whole page, babe! this lil writeup came straight out of the libstdc++ docs β€” footer says libstdc++, std::_List..., _Alloc >(3), manual section 3, Library Functions Manual. no cap, that's all she wrote. go read _Deque_base and slay. πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms