__GNU_PBDS::DETAIL::PAT_TRIE_MAP(3)
β¨ NAME β¨
okay bestie, say hi to __gnu_pbds::detail::pat_trie_map< Key, Mapped, Node_And_It_Traits, _Alloc > β it's a PATRICIA trie. that's it, that's the name, she's a whole data structure π
this one lives in the Library Functions Manual (libstdc++ girlies, this is your section 3 moment).
πΈ SYNOPSIS πΈ
#include <pat_trie_.hpp>
she inherits , and . β no literally, that's all the source says, the blanks are blank, don't come for me π
π Public Types π
access_traitsβtraits_type::access_traitsallocator_typeβ_Alloccomp_hashβstd::pair< size_type, size_type >const_iteratorβpoint_const_iteratorconst_pointerβtraits_base::const_pointerconst_referenceβtraits_base::const_referenceconst_reverse_iteratorβtraits_type::const_reverse_iteratorcontainer_categoryβpat_trie_tagdifference_typeβ_Alloc::difference_typeiteratorβpoint_iteratorkey_const_pointerβtraits_base::key_const_pointerkey_const_referenceβtraits_base::key_const_referencekey_pointerβtraits_base::key_pointerkey_referenceβtraits_base::key_referencekey_typeβtraits_base::key_typemapped_const_pointerβtraits_base::mapped_const_pointermapped_const_referenceβtraits_base::mapped_const_referencemapped_pointerβtraits_base::mapped_pointermapped_referenceβtraits_base::mapped_referencemapped_typeβtraits_base::mapped_typeno_throw_indicatorβ__nothrowcopy::indicatornode_const_iteratorβtraits_type::node_const_iteratornode_iteratorβtraits_type::node_iteratornode_typeβ enum, and the values arei_node,leaf_node,head_node. three types of nodes, that's the whole vibe checknode_updateβtraits_type::node_updatepoint_const_iteratorβtraits_type::const_iteratorpoint_iteratorβtraits_type::iteratorpointerβtraits_base::pointerreferenceβtraits_base::referencereverse_iteratorβtraits_type::reverse_iteratorsize_typeβ_Alloc::size_typestore_extraβintegral_constant< int, Store_Hash >stored_data_typeβstored_data< value_type, size_type, Store_Hash >value_typeβtraits_base::value_type
π Public Member Functions π
pat_trie_map (const access_traits &)pat_trie_map (const pat_trie_map< Key, Mapped, Node_And_It_Traits, _Alloc > &)iterator begin ()const_iterator begin () constvoid clear ()bool empty () constiterator end ()const_iterator end () constconst_iterator erase (const_iterator)const_reverse_iterator erase (const_reverse_iterator)iterator erase (iterator)bool erase (key_const_reference)reverse_iterator erase (reverse_iterator)template<typename Pred> size_type erase_if (Pred)point_iterator find (key_const_reference)point_const_iterator find (key_const_reference) constaccess_traits & get_access_traits ()const access_traits & get_access_traits () constnode_update & get_node_update ()const node_update & get_node_update () conststd::pair< point_iterator, bool > insert (const_reference)void join (pat_trie_map< Key, Mapped, Node_And_It_Traits, _Alloc > &)point_iterator lower_bound (key_const_reference)point_const_iterator lower_bound (key_const_reference) constsize_type max_size () constnode_iterator node_begin ()β hands you anode_iteratorpointing at the node at the root of the tree π±node_const_iterator node_begin () constβ same energy but const: a constnode_iteratorfor the root nodenode_iterator node_end ()β anode_iteratorfor a node just after a leaf of the tree πnode_const_iterator node_end () constβ the const version: a constnode_iteratorjust after a leafmapped_reference operator[] (key_const_reference r_key)reverse_iterator rbegin ()const_reverse_iterator rbegin () constreverse_iterator rend ()const_reverse_iterator rend () constsize_type size () constvoid split (key_const_reference, pat_trie_map< Key, Mapped, Node_And_It_Traits, _Alloc > &)void swap (pat_trie_map< Key, Mapped, Node_And_It_Traits, _Alloc > &)point_iterator upper_bound (key_const_reference)point_const_iterator upper_bound (key_const_reference) const
π Public Attributes π
no_throw_indicator m_no_throw_copies_indicatorstore_extra m_store_extra_indicator
π«Ά Protected Member Functions π«Ά
template<typename It> void copy_from_range (It, It)node_pointer recursive_copy_node (node_const_pointer)void value_swap (pat_trie_map< Key, Mapped, Node_And_It_Traits, _Alloc > &)
π¦ Detailed Description π¦
template<typename Key, typename Mapped, typename Node_And_It_Traits,
typename _Alloc>
class __gnu_pbds::detail::pat_trie_map< Key, Mapped, Node_And_It_Traits,
_Alloc >
PATRICIA trie. she's iconic, she's a trie, she said what she said β¨
this implementation loosely borrows ideas from:
- Fast Mergeable Integer Maps, Okasaki, Gill 1998
- Ptset: Sets of integers implemented as Patricia trees, Jean-Christophe Filliatr, 2000
note the word loosely, bestie. that's the source's own word, not mine, and I'm not adding lore where there isn't any π
π Member Enumeration Documentation π
enum __gnu_pbds::detail::pat_trie_base::node_type [inherited]
three types of nodes, periodt. i_node is used by _Inode, leaf_node by _Leaf, and head_node by _Head. that's the whole taxonomy, slay π
β Member Function Documentation β
node_begin () [inline]
template<typename Key, typename Mapped, typename Node_And_It_Traits,
typename _Alloc> pat_trie_map< Key, Mapped, Node_And_It_Traits, _Alloc
>::node_iterator __gnu_pbds::detail::pat_trie_map< Key, Mapped,
Node_And_It_Traits, _Alloc >::node_begin ()
returns a node_iterator corresponding to the node at the root of the tree. the root. the main character. the head node energy. π³
node_begin () const [inline]
template<typename Key, typename Mapped, typename Node_And_It_Traits,
typename _Alloc> pat_trie_map< Key, Mapped, Node_And_It_Traits, _Alloc
>::node_const_iterator __gnu_pbds::detail::pat_trie_map< Key, Mapped,
Node_And_It_Traits, _Alloc >::node_begin () const
returns a const node_iterator corresponding to the node at the root of the tree. same root, but she's const now, respect her boundaries π«Ά
node_end () [inline]
template<typename Key, typename Mapped, typename Node_And_It_Traits,
typename _Alloc> pat_trie_map< Key, Mapped, Node_And_It_Traits, _Alloc
>::node_iterator __gnu_pbds::detail::pat_trie_map< Key, Mapped,
Node_And_It_Traits, _Alloc >::node_end ()
returns a node_iterator corresponding to a node just after a leaf of the tree. like, one past the leaf. off the edge. end-of-range coded π
node_end () const [inline]
template<typename Key, typename Mapped, typename Node_And_It_Traits,
typename _Alloc> pat_trie_map< Key, Mapped, Node_And_It_Traits, _Alloc
>::node_const_iterator __gnu_pbds::detail::pat_trie_map< Key, Mapped,
Node_And_It_Traits, _Alloc >::node_end () const
returns a const node_iterator corresponding to a node just after a leaf of the tree. const version, same spot just past the leaf, no cap π
π Author π
generated automatically by Doxygen for libstdc++ from the source code. not a human author, just a robot doing her best π§
okay that's the whole page!! and for the little sign-off at the bottom: this beauty is a libstdc++ situation, and the footer is just the manual name β __gnu_pbds...s, _Alloc >(3) β printed next to it. no date in sight, so don't ask me for one, I'm not inventing dates bestie ππ
she ate, honestly. bye!! πΈβ¨
π¦ 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