__GNU_PBDS::TRIE_STRING_ACCESS_TRAITS(3)

πŸ“¦
version 16.2.1+r23+gd564253eb6c8 Β· 5 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44

πŸ’– __gnu_pbds::trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc > πŸ’–

okay so bestie, welcome to the Library Functions Manual section 3 ✨ β€” that's the C++ library corner of the man pages, and today's main character is a little struct from libstdc++ called trie_string_access_traits. she's giving very much "glue code that makes tries go brrr" and honestly? iconic. let's get into it 🫢


✨ NAME ✨

__gnu_pbds::trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc > β€” no cap, that's the whole name, template params and all πŸ’…


🌈 SYNOPSIS 🌈

first things first, you gotta pull her in:

#include <trie_policy.hpp>

that's it. that's the doorway. slay 🌸

πŸŽ€ Public Types πŸŽ€

  • enum { reverse } β€” yep, just vibes, a nameless enum with one member in it
  • enum { min_e_val, max_e_val, max_size } β€” three more nameless-enum besties, all lowercase, all valid
  • typedef detail::__conditional_type< Reverse, typenameString::const_reverse_iterator, typenameString::const_iterator >::__type const_iterator β€” Element const iterator type. this is the iterator she hands you, and yes, whether it's forward or reverse literally depends on Reverse β€” the way that she switches up based on a bool?? main character behaviour fr fr
  • typedef std::iterator_traits< const_iterator >::value_type e_type β€” Element type.
  • typedef detail::rebind_traits< _Alloc, key_type >::const_reference key_const_reference
  • typedef String key_type
  • typedef _Alloc::size_type size_type

πŸ¦‹ Static Public Member Functions πŸ¦‹

  • static const_iterator begin (key_const_reference) β€” Returns a const_iterator to the first element of key_const_reference agumnet. (yes "agumnet", that's a typo and it's staying, we don't edit the ancestors πŸ₯²)
  • static size_type e_pos (e_type e) β€” Maps an element to a position.
  • static const_iterator end (key_const_reference) β€” Returns a const_iterator to the after-last element of key_const_reference argument.

πŸ”₯ Detailed Description πŸ”₯

okay the actual declaration, hold onto your scrunchie:

template<typename String = std::string, typename String::value_type
    Min_E_Val = detail::__numeric_traits<typename
    String::value_type>::__min, typename String::value_type Max_E_Val =
    detail::__numeric_traits<typename String::value_type>::__max, bool
    Reverse = false, typename _Alloc = std::allocator<char>>
struct __gnu_pbds::trie_string_access_traits< String, Min_E_Val,
Max_E_Val, Reverse, _Alloc >

and the description is literally just: Element access traits for string types. she's concise, she knows her worth πŸ’…

look at those defaults tho β€” String = std::string, Reverse = false, _Alloc = std::allocator<char>, and Min_E_Val / Max_E_Val auto-pulled from detail::__numeric_traits<typename String::value_type>::__min and ...::__max. lowkey elegant, highkey templated 🧚

🌸 Template Parameters 🌸

  • String β€” String type.
  • Min_E_Val β€” Minimal element value.
  • Max_E_Val β€” Maximum element value.
  • Reverse β€” Reverse iteration should be used. Default: false.
  • _Alloc β€” Allocator type.

πŸ’œ Member Typedef Documentation πŸ’œ

const_iterator

template<typename String = std::string, typename String::value_type
    Min_E_Val = detail::__numeric_traits<typename
    String::value_type>::__min, typename String::value_type Max_E_Val =
    detail::__numeric_traits<typename String::value_type>::__max, bool
    Reverse = false, typename _Alloc = std::allocator<char>>
typedef
    detail::__conditional_type<Reverse,typenameString::const_reverse_iterator,typenameString::const_iterator>::__type
    __gnu_pbds::trie_string_access_traits< String, Min_E_Val, Max_E_Val,
    Reverse, _Alloc >::const_iterator

Element const iterator type. πŸ¦‹

e_type

template<typename String = std::string, typename String::value_type
    Min_E_Val = detail::__numeric_traits<typename
    String::value_type>::__min, typename String::value_type Max_E_Val =
    detail::__numeric_traits<typename String::value_type>::__max, bool
    Reverse = false, typename _Alloc = std::allocator<char>>
typedef std::iterator_traits<const_iterator>::value_type
    __gnu_pbds::trie_string_access_traits< String, Min_E_Val, Max_E_Val,
    Reverse, _Alloc >::e_type

Element type. πŸ“


πŸ‘‘ Member Function Documentation πŸ‘‘

🌟 begin

template<typename String, typename String::value_type Min_E_Val, typename
    String::value_type Max_E_Val, bool Reverse, typename _Alloc>
trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc
>::const_iterator __gnu_pbds::trie_string_access_traits< String,
Min_E_Val, Max_E_Val, Reverse, _Alloc >::begin (key_const_reference
r_key) [inline],  [static]

Returns a const_iterator to the first element of key_const_reference agumnet. she's [inline] and [static], a true overachiever ✨

🌟 e_pos

template<typename String, typename String::value_type Min_E_Val, typename
    String::value_type Max_E_Val, bool Reverse, typename _Alloc>
trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc
>::size_type __gnu_pbds::trie_string_access_traits< String, Min_E_Val,
Max_E_Val, Reverse, _Alloc >::e_pos (e_type e) [inline],  [static]

Maps an element to a position. takes an e_type e, hands back a size_type. ate πŸ’…

🌟 end

template<typename String, typename String::value_type Min_E_Val, typename
    String::value_type Max_E_Val, bool Reverse, typename _Alloc>
trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc
>::const_iterator __gnu_pbds::trie_string_access_traits< String,
Min_E_Val, Max_E_Val, Reverse, _Alloc >::end (key_const_reference r_key)
[inline],  [static]

Returns a const_iterator to the after-last element of key_const_reference argument. classic end-iterator energy, she's the after-last one, periodt 🌈

🫢 tiny heads-up bestie: begin and end both take key_const_reference, and e_pos takes e_type e. don't mix those up or the compiler will simply end you πŸ’€

πŸŽ€ Author πŸŽ€

Generated automatically by Doxygen for libstdc++ from the source code.


and that's the whole page, bestie!! πŸ“–βœ¨ every single bit of her came straight out of the libstdc++ man pages, section 3 of the Library Functions Manual β€” the footer said libstdc++ and I said say less πŸ’… go forth and trie, iykyk πŸ’– πŸ¦‹ 🌸 🧚

πŸ“¦ 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
  • centos-stream 10: gcc-toolset-15-libstdc++-docs 15.2.1-8.1.el10 Β· 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
  • centos-stream 10: gcc-toolset-16-libstdc++-docs 16.2.1-1.3.el10 Β· 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
  • centos-stream 10: libstdc++-docs 14.4.1-4.el10 Β· 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 43: libstdc++-docs 15.2.1-2.fc43 Β· 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 43: libstdc++-docs 15.3.1-1.fc43 Β· 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.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