__GNU_PBDS::TRIE(3cxx)
πΈ NAME πΈ
__gnu_pbds::trie< Key, Mapped, _ATraits, Tag, Node_Update, _Alloc > β bestie, this is the trie-based container from libstdc++'s PBDS, and it's in the 3cxx manual section, iykyk π
β¨ SYNOPSIS β¨
Okay so first thing, you gotta pull it in like this:
#include <assoc_container.hpp>
And heads up, it Inherits __gnu_pbds::basic_branch< Key, Mapped, Tag, Node_Update, Policy_Tl, _Alloc >. Not me clocking the inheritance chain on the first date π
π Public Types π
typedef _ATraits access_traitsβ the element access traits type. That's the whole vibe of this one.typedef Node_Update node_updateβ literally just that, no extra lore in the source.
π¦ Public Member Functions π¦
trie (const access_traits &t)β the constructor that takes some policy objects.r_access_traitsgets copied by the_ATraitsobject of the container object. (Yes, it saysr_access_traitsβ quoting the original verbatim, don't come for me π)trie (const trie &other)β copy constructor, classic, iconic.template<typename It > trie (It first, It last)β constructor taking__iteratorsto a range ofvalue_types. Everything betweenfirst_itandlast_itgets inserted into the container object. π«Άtemplate<typename It > trie (It first, It last, const access_traits &t)β same range situation but also with some policy objects. Thevalue_typesbetweenfirst_itandlast_itwill be inserted into the container object. slay.trie & operator= (const trie &other)β assignment operator, does what it says on the tin.void swap (trie &other)β swaps, no cap.
π Detailed Description π
Here's the whole declaration, exactly as written, zero edits:
template<typename Key, typename Mapped, typename _ATraits = typename
detail::default_trie_access_traits<Key>::type, typename Tag =
pat_trie_tag, template< typename Node_CItr, typename Node_Itr, typename
_ATraits_, typename _Alloc_ > class Node_Update = null_node_update,
typename _Alloc = std::allocator<char>>
class __gnu_pbds::trie< Key, Mapped, _ATraits, Tag, Node_Update, _Alloc >
"A trie-based container." β the official description, and honestly? She said it in four words. main character energy β
π Template Parameters π
Keyβ Key type.Mappedβ Map type._ATraitsβ Element access traits.Tagβ instantiating data structure type, seecontainer_tag.Node_Updateβ updates trie internal-nodes, restores invariants when invalidated. XXX Seedesign::tree-based-containersnodeinvariants._Allocβ Allocator type.
Base tag choice is pat_trie_tag π
Base is basic_branch.
π§ Member Typedef Documentation π§
Same declaration, one more time, because the typedef lives inside it:
template<typename Key , typename Mapped , typename _ATraits = typename
detail::default_trie_access_traits<Key>::type, typename Tag =
pat_trie_tag, template< typename Node_CItr, typename Node_Itr, typename
_ATraits_, typename _Alloc_ > class Node_Update = null_node_update,
typename _Alloc = std::allocator<char>>
typedef _ATraits
__gnu_pbds::trie< Key, Mapped, _ATraits, Tag, Node_Update, _Alloc >::access_traits
Element access traits type. That's it, that's the typedef π
π Constructor & Destructor Documentation π
πΈ trie (const access_traits & t) β [inline]
template<typename Key , typename Mapped , typename _ATraits = typename
detail::default_trie_access_traits<Key>::type, typename Tag =
pat_trie_tag, template< typename Node_CItr, typename Node_Itr, typename
_ATraits_, typename _Alloc_ > class Node_Update = null_node_update,
typename _Alloc = std::allocator<char>>
__gnu_pbds::trie< Key, Mapped, _ATraits, Tag, Node_Update, _Alloc >::trie (const access_traits & t) [inline]
Constructor taking some policy objects. r_access_traits will be copied by the _ATraits object of the container object.
πΈ trie (It first, It last) β [inline]
template<typename Key , typename Mapped , typename _ATraits = typename
detail::default_trie_access_traits<Key>::type, typename Tag =
pat_trie_tag, template< typename Node_CItr, typename Node_Itr, typename
_ATraits_, typename _Alloc_ > class Node_Update = null_node_update,
typename _Alloc = std::allocator<char>>
template<typename It >
__gnu_pbds::trie< Key, Mapped, _ATraits, Tag, Node_Update, _Alloc >::trie (It first, It last) [inline]
Constructor taking __iterators to a range of value_types. The value_types between first_it and last_it will be inserted into the container object. feed her a range and she eats π₯
πΈ trie (It first, It last, const access_traits & t) β [inline]
template<typename Key , typename Mapped , typename _ATraits = typename
detail::default_trie_access_traits<Key>::type, typename Tag =
pat_trie_tag, template< typename Node_CItr, typename Node_Itr, typename
_ATraits_, typename _Alloc_ > class Node_Update = null_node_update,
typename _Alloc = std::allocator<char>>
template<typename It >
__gnu_pbds::trie< Key, Mapped, _ATraits, Tag, Node_Update, _Alloc >::trie (It first, It last, const access_traits & t) [inline]
Constructor taking __iterators to a range of value_types and some policy objects. The value_types between first_it and last_it will be inserted into the container object. range + policies = the full package π
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. Not a human, just a robot doing her little documentation thing π€β¨
okay that's the whole page bestie, we got through it together π«Ά go build a trie, ily, bye π
tiny sign-off before you close the tab: this whole page came out of libstdc++, manual section 3cxx, and the footer on the original read libstd__gnu_pbds::tr...pdate, _Alloc >(3cxx) β auto-generated Doxygen output, no date in sight, periodt π
π¦ where this page comes from
- debian trixie: libstdc++-12-doc 12.4.0-5
- debian trixie: libstdc++-13-doc 13.3.0-16
- debian trixie: libstdc++-14-doc 14.2.0-19
- ubuntu noble: libstdc++-10-doc 10.5.0-4ubuntu2
- ubuntu noble: libstdc++-10-doc 10.5.0-4ubuntu2.1
- ubuntu noble: libstdc++-11-doc 11.4.0-9ubuntu1
- ubuntu noble: libstdc++-11-doc 11.5.0-1ubuntu1~24.04.1
- ubuntu noble: libstdc++-12-doc 12.3.0-17ubuntu1
- ubuntu noble: libstdc++-12-doc 12.4.0-2ubuntu1~24.04.1
- ubuntu noble: libstdc++-13-doc 13.2.0-23ubuntu4
- ubuntu noble: libstdc++-13-doc 13.3.0-6ubuntu2~24.04.1
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- ubuntu noble: libstdc++-14-doc 14.2.0-4ubuntu2~24.04.1
- ubuntu questing: libstdc++-11-doc 11.5.0-7ubuntu1
- ubuntu questing: libstdc++-11-doc 11.5.0-7ubuntu1.1
- ubuntu questing: libstdc++-12-doc 12.5.0-6ubuntu1
- ubuntu questing: libstdc++-13-doc 13.4.0-4ubuntu1
- ubuntu questing: libstdc++-14-doc 14.3.0-8ubuntu1
- ubuntu questing: libstdc++-15-doc 15.2.0-4ubuntu4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms