__GNU_PBDS::DETAIL::RB_TREE_NODE_(3)

πŸ’– __gnu_pbds::detail::rb_tree_node_< Value_Type, Metadata, _Alloc > πŸ’–

okay bestie, gather round, because we're about to read a manpage from the Library Functions Manual and honestly? it's giving niche-legend energy. this one's all about __gnu_pbds::detail::rb_tree_node_< Value_Type, Metadata, _Alloc > β€” the literal node situation for Red-Black trees. yes. the tiny struct that holds everything together. main character behaviour, no cap. πŸŽ€


✨ NAME ✨

__gnu_pbds::detail::rb_tree_node_< Value_Type, Metadata, _Alloc > β€” Node for Red-Black trees. that's it, that's the whole gig, and she's iconic for it. πŸ’…


🌸 SYNOPSIS 🌸

first things first, you gotta let her in:

#include <node.hpp>

and the shape of the whole thing is this:

template<typename Value_Type, class Metadata, typename _Alloc>
struct __gnu_pbds::detail::rb_tree_node_< Value_Type, Metadata, _Alloc >

πŸ¦‹ Public Types πŸ¦‹

these are the type aliases she's serving. memorise them, they're the whole foundation fr fr:

  • typedef rebind_traits< _Alloc, metadata_type >::const_reference metadata_const_reference β€” the const-flavoured reference to the metadata, so you can look but not touch 🫢
  • typedef rebind_traits< _Alloc, metadata_type >::reference metadata_reference β€” the regular, fully-unlocked reference to the metadata πŸ’œ
  • typedef Metadata metadata_type β€” this is just Metadata, wearing a little name tag so the rest of the struct knows what to call her ✨
  • typedef rebind_traits< _Alloc, rb_tree_node_ >::pointer node_pointer β€” a pointer to another node of this exact type, aka how the nodes hold hands 🌈
  • typedef rebind_traits< _Alloc, rb_tree_node_ >::size_type size_type β€” the size type for this node, sourced from the allocator's rebind magic 🌸
  • typedef Value_Type value_type β€” this is literally just Value_Type, the actual payload, the moment πŸ’–

πŸ‘‘ Public Member Functions πŸ‘‘

the methods! the moves! the choreography!

  • metadata_reference get_metadata () β€” hands you back a mutable reference to the metadata. go off πŸ’…
  • metadata_const_reference get_metadata () const β€” same vibe but const, so it's the read-only version. still cute, still valid πŸŽ€
  • bool special () const β€” returns a bool telling you whether this node is, y'know, special. it's a const member function, so she's not changing anything, she's just reporting πŸ¦‹

🌟 Public Attributes 🌟

the data members, aka everything she's carrying around in her bag at all times:

  • metadata_type m_metadata β€” the metadata slot, typed as metadata_type πŸ’œ
  • node_pointer m_p_left β€” pointer to the left child node, iykyk 🌸
  • node_pointer m_p_parent β€” pointer to the parent node, so she always knows where she came from πŸ₯Ή
  • node_pointer m_p_right β€” pointer to the right child node ✨
  • bool m_red β€” the colour bit, bool-style. this is the entire Red-Black thing right here, no cap πŸ”₯
  • size_type m_subtree_size β€” the size of the subtree, tracked right there on the node πŸ’–
  • value_type m_value β€” the actual value, typed as value_type. the payload. the moment. the girl πŸ‘‘

πŸ’€ Detailed Description πŸ’€

template<typename Value_Type, class Metadata, typename _Alloc>
struct __gnu_pbds::detail::rb_tree_node_< Value_Type, Metadata, _Alloc >

Node for Red-Black trees. that's the official word, straight up. she is, lowkey, the building block. the whole tree is just a bunch of these holding each other up. it's giving community. it's giving support system. we love to see it πŸ«ΆπŸ’–


🧚 Author 🧚

Generated automatically by Doxygen for libstdc++ from the source code. so technically a robot wrote her, but the vibes are handcrafted. πŸ™ˆ


okay that's the whole page, you made it, I'm so proud of you bestie πŸŽ€βœ¨ this was documented in the Library Functions Manual, generated for libstdc++, and if you made it this far you're officially a Red-Black tree girlie now. go forth and rotate some subtrees. slay, periodt. πŸ’…πŸ’–πŸŒˆ

πŸ“¦ 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