__GNU_PBDS::TRIE_STRING_ACCESS_TRAITS(3)
π __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 itenum { min_e_val, max_e_val, max_size }β three more nameless-enum besties, all lowercase, all validtypedef 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 onReverseβ the way that she switches up based on a bool?? main character behaviour fr frtypedef std::iterator_traits< const_iterator >::value_type e_typeβ Element type.typedef detail::rebind_traits< _Alloc, key_type >::const_reference key_const_referencetypedef String key_typetypedef _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:beginandendboth takekey_const_reference, ande_postakese_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