__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 justMetadata, 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 justValue_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 butconst, so it's the read-only version. still cute, still valid πbool special () constβ returns abooltelling you whether this node is, y'know, special. it's aconstmember 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 asmetadata_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 asvalue_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