__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_traits gets copied by the _ATraits object of the container object. (Yes, it says r_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 __iterators to a range of value_types. Everything between first_it and last_it gets 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. The value_types between first_it and last_it will 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, see container_tag.
  • Node_Update β€” updates trie internal-nodes, restores invariants when invalidated. XXX See design::tree-based-containersnode invariants.
  • _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 🌟