__gnu_debug(3cxx)

πŸ’– NAME πŸ’–

okay so bestie, welcome to __gnu_debug(3cxx) β€” the GNU debug classes for public use. this page is basically the group chat for debug-mode classes, and we're doing the full roster. no cap, no skips, no "lol I'll summarise later." ✨

__gnu_debug β€” GNU debug classes for public use.


πŸŽ€ SYNOPSIS πŸŽ€

bestie, this is the master list. every class, every typedef, every enum value. we are not skipping the "boring" ones, because there are no boring ones. πŸ’…

🧚 Classes 🧚

  • class _After_nth_from β€” listed here with no extra blurb. mysterious. iconic. we respect it. πŸ¦‹
  • struct _BeforeBeginHelper β€” also no extra description, just a struct doing its thing. πŸŽ€
  • class _Equal_to β€” no extra blurb in the page. she's giving quiet-luxury comparator energy. πŸ’œ
  • class _Not_equal_to β€” same deal: name only, no description. lowkey iconic. ✨
  • class _Safe_container β€” a safe class dealing with some allocator dependent operations. 🫢
  • class _Safe_forward_list β€” special iterators swap and invalidation for forward_list because of the before_begin iterator. yes, that one. πŸ’…
  • class _Safe_iterator β€” safe iterator wrapper. simple, clean, slay. πŸ”₯
  • class _Safe_iterator_base β€” basic functionality for a safe iterator. the foundation. the blueprint. πŸ‘‘
  • class _Safe_local_iterator β€” safe iterator wrapper. again. and we love that for her. 🌸
  • class _Safe_local_iterator_base β€” basic functionality for a safe iterator. also again. also essential. πŸ’–
  • class _Safe_node_sequence β€” like _Safe_sequence but with a special _M_invalidate_all implementation not invalidating past-the-end iterators. used by node based sequence. okayyy, very specific, very demure. πŸŽ€
  • class _Safe_sequence β€” base class for constructing a safe sequence type that tracks iterators that reference it. tracking! iterators! reference! the drama. 😭
  • class _Safe_sequence_base β€” base class that supports tracking of iterators that reference a sequence. the base-est base. 🧚
  • class _Safe_unordered_container β€” base class for constructing a safe unordered container type that tracks iterators that reference it. unordered but emotionally ordered. πŸ’œ
  • class _Safe_unordered_container_base β€” base class that supports tracking of local iterators that reference an unordered container. local iterator tracking rights! 🫢
  • class _Safe_vector β€” base class for Debug Mode vector. yes bestie, vector but debug mode. 🌈
  • struct _Sequence_traits β€” no extra description given. mysterious struct behavior. we stan. ⭐
  • class basic_string β€” class std::basic_string with safety/checking/debug instrumentation. the string, but with the safety checks on. πŸ’…

πŸ¦‹ Typedefs πŸ¦‹

  • typedef basic_string< char > string β€” no extra blurb, just the char string typedef living her life. ✨
  • typedef basic_string< char16_t > u16string β€” a string of char16_t. πŸ’–
  • typedef basic_string< char32_t > u32string β€” a string of char32_t. πŸ’–
  • typedef basic_string< wchar_t > wstring β€” no extra description in the page. she's just here with her wchar_t self. 🌸

🌈 Enumerations 🌈

bestie, the first enum is long. like, scroll-for-a-bit long. here is every single value, exactly:

enum _Debug_msg_id { __msg_valid_range, __msg_insert_singular,
    __msg_insert_different, __msg_erase_bad, __msg_erase_different,
    __msg_subscript_oob, __msg_empty, __msg_unpartitioned,
    __msg_unpartitioned_pred, __msg_unsorted, __msg_unsorted_pred,
    __msg_not_heap, __msg_not_heap_pred, __msg_bad_bitset_write,
    __msg_bad_bitset_read, __msg_bad_bitset_flip, __msg_self_splice,
    __msg_splice_alloc, __msg_splice_bad, __msg_splice_other,
    __msg_splice_overlap, __msg_init_singular, __msg_init_copy_singular,
    __msg_init_const_singular, __msg_copy_singular, __msg_bad_deref,
    __msg_bad_inc, __msg_bad_dec, __msg_iter_subscript_oob,
    __msg_advance_oob, __msg_retreat_oob, __msg_iter_compare_bad,
    __msg_compare_different, __msg_iter_order_bad,
    __msg_order_different, __msg_distance_bad, __msg_distance_different,
    __msg_deref_istream, __msg_inc_istream, __msg_output_ostream,
    __msg_deref_istreambuf, __msg_inc_istreambuf,
    __msg_insert_after_end, __msg_erase_after_bad, __msg_valid_range2,
    __msg_local_iter_compare_bad, __msg_non_empty_range,
    __msg_self_move_assign, __msg_bucket_index_oob,
    __msg_valid_load_factor, __msg_equal_allocs,
    __msg_insert_range_from_self, __msg_irreflexive_ordering }

and the second enum is shorter but still important:

enum _Distance_precision { __dp_none, __dp_equality, __dp_sign,
    __dp_sign_max_size, __dp_exact }

part 2 has more, and we're keeping the energy at 100. πŸ¦‹

πŸ’– DESCRIPTION πŸ’–

okay so this is the part where the page dumps the entire function roster β€” every helper this debug-mode header ships with. yes it's long. yes we're doing all of them, no skips, no "ngl I got bored". copy these signatures character for character please, they're load-bearing 🫢


✨ Functions ✨

__base πŸŽ€

the "gimme the underlying iterator" family. four flavours, all constexpr except the safe-iterator one:

  • template<typename _Iterator > constexpr _Iterator __base (_Iterator __it) β€” the plain generic flavour. any _Iterator walks in, _Iterator walks out, very demure ✨
  • template<typename _Iterator , typename _Sequence > _Iterator __base (const _Safe_iterator< _Iterator, _Sequence, std::random_access_iterator_tag > &__it) β€” the _Safe_iterator flavour, and it's specifically tagged std::random_access_iterator_tag. note there's no constexpr on this one, bestie, don't add one πŸ’…
  • template<typename _Iterator > constexpr auto __base (const std::move_iterator< _Iterator > &__it) -> decltype(std::make_move_iterator(__base(__it.base()))) β€” the std::move_iterator flavour, and the return type is that whole decltype(std::make_move_iterator(__base(__it.base()))) situation. it unwraps and re-wraps, iconic πŸ”₯
  • template<typename _Iterator , typename _Sequence > constexpr std::reverse_iterator< _Iterator > __base (const std::reverse_iterator< _Safe_iterator< _Iterator, _Sequence, std::random_access_iterator_tag > > &__it) β€” reverse-of-safe-random-access, returns a std::reverse_iterator< _Iterator >. nesting so deep it's giving inception πŸŒ€

__can_advance πŸ¦‹

eight overloads, and yes you need all eight. the pattern is: one takes a _Size, the other takes a std::pair< _Diff, _Distance_precision > & plus an int:

  • template<typename _InputIterator , typename _Size > constexpr bool __can_advance (_InputIterator, _Size) β€” the bare _InputIterator + _Size flavour. note the parameters are unnamed here, that's literally how it's written πŸ‘€
  • template<typename _InputIterator , typename _Diff > constexpr bool __can_advance (_InputIterator, const std::pair< _Diff, _Distance_precision > &, int) β€” same energy but with the std::pair< _Diff, _Distance_precision > & and an int. also unnamed params, also constexpr πŸ’«
  • template<typename _Iterator , typename _Sequence , typename _Category , typename _Size > bool __can_advance (const _Safe_iterator< _Iterator, _Sequence, _Category > &, _Size) β€” the _Safe_iterator take, _Category included, _Size included, and heads up: not constexpr this time 🚨
  • template<typename _Iterator , typename _Sequence , typename _Category , typename _Diff > bool __can_advance (const _Safe_iterator< _Iterator, _Sequence, _Category > &, const std::pair< _Diff, _Distance_precision > &, int) β€” the safe-iterator + std::pair< _Diff, _Distance_precision > & + int combo. no constexpr, we've been over this 😀
  • template<typename _Iterator , typename _Size > constexpr bool __can_advance (const std::move_iterator< _Iterator > &__it, _Size __n) β€” move-iterator flavour, __it and __n got names this time, constexpr is back on the menu πŸŽ€
  • template<typename _Iterator , typename _Diff > constexpr bool __can_advance (const std::move_iterator< _Iterator > &__it, const std::pair< _Diff, _Distance_precision > &__dist, int __way) β€” move-iterator, pair named __dist, int named __way. main character naming energy πŸ‘‘
  • template<typename _Iterator , typename _Size > constexpr bool __can_advance (const std::reverse_iterator< _Iterator > &__it, _Size __n) β€” reverse flavour, same __it + __n deal, still constexpr 🌸
  • template<typename _Iterator , typename _Diff > constexpr bool __can_advance (const std::reverse_iterator< _Iterator > &__it, const std::pair< _Diff, _Distance_precision > &__dist, int __way) β€” reverse + __dist + __way. that's the whole set, we ate πŸ“

__check_partitioned_lower / __check_partitioned_upper 🧚

four total, two each, and the only difference within each pair is whether a _Pred shows up:

  • template<typename _ForwardIterator , typename _Tp > constexpr bool __check_partitioned_lower (_ForwardIterator __first, _ForwardIterator __last, const _Tp &__value) β€” the lower one, no predicate, just __first, __last, __value πŸ’œ
  • template<typename _ForwardIterator , typename _Tp , typename _Pred > constexpr bool __check_partitioned_lower (_ForwardIterator __first, _ForwardIterator __last, const _Tp &__value, _Pred __pred) β€” same but with a _Pred __pred bolted on. _ForwardIterator is the iterator type both times, don't get it twisted ✨
  • template<typename _ForwardIterator , typename _Tp > constexpr bool __check_partitioned_upper (_ForwardIterator __first, _ForwardIterator __last, const _Tp &__value) β€” the upper twin of the first one. matching set, obsessed πŸŽ€
  • template<typename _ForwardIterator , typename _Tp , typename _Pred > constexpr bool __check_partitioned_upper (_ForwardIterator __first, _ForwardIterator __last, const _Tp &__value, _Pred __pred) β€” upper + _Pred __pred. pair complete, slay πŸ’…

__check_singular & __check_singular_aux πŸ”

  • template<typename _Iterator > constexpr bool __check_singular (_Iterator const &) β€” constexpr, takes an unnamed _Iterator const &. yes the const is after the type, keep it πŸ’«
  • template<typename _Tp > constexpr bool __check_singular (_Tp *const &__ptr) β€” the pointer flavour, _Tp *const &__ptr. that's a const reference to a const pointer, and no we're not simplifying it 😭
  • bool __check_singular_aux (const _Safe_iterator_base *__x) β€” the _Safe_iterator_base aux, named __x, and it is not a template and not constexpr 🚨
  • bool __check_singular_aux (const class _Safe_iterator_base *) β€” okay so yes, this looks like the same thing again with class in front and no parameter name. that is fr fr what's printed, do not "clean it up" πŸ‘€
  • bool __check_singular_aux (const void *) β€” and the const void * catch-all. three aux overloads, periodt 🌈

__check_sorted & friends 🎡

  • template<typename _InputIterator > constexpr bool __check_sorted (const _InputIterator &__first, const _InputIterator &__last) β€” the two-arg version, const refs to _InputIterator, constexpr βœ…
  • template<typename _InputIterator , typename _Predicate > constexpr bool __check_sorted (const _InputIterator &__first, const _InputIterator &__last, _Predicate __pred) β€” same plus a _Predicate __pred (note: not a const ref for the predicate, bestie) πŸŽ”

the _aux crew, dispatched on iterator tag β€” four of them:

  • template<typename _ForwardIterator , typename _Predicate > constexpr bool __check_sorted_aux (_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, std::forward_iterator_tag) β€” forward tag with a predicate πŸ’–
  • template<typename _ForwardIterator > constexpr bool __check_sorted_aux (_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) β€” forward tag, no predicate. by-value iterators here, keep them by value 🫢
  • template<typename _InputIterator , typename _Predicate > constexpr bool __check_sorted_aux (const _InputIterator &, const _InputIterator &, _Predicate, std::input_iterator_tag) β€” input tag with predicate, all params unnamed. mysterious. love that for her πŸ¦‹
  • template<typename _InputIterator > constexpr bool __check_sorted_aux (const _InputIterator &, const _InputIterator &, std::input_iterator_tag) β€” input tag, no predicate, still unnamed. four flavours, all constexpr, no cap ⭐

__check_sorted_set & __check_sorted_set_aux πŸ“

  • template<typename _InputIterator1 , typename _InputIterator2 > constexpr bool __check_sorted_set (const _InputIterator1 &__first, const _InputIterator1 &__last, const _InputIterator2 &) β€” two different iterator types, first two params named, third one just const _InputIterator2 & with no name πŸ™ˆ
  • template<typename _InputIterator1 , typename _InputIterator2 , typename _Predicate > constexpr bool __check_sorted_set (const _InputIterator1 &__first, const _InputIterator1 &__last, const _InputIterator2 &, _Predicate __pred) β€” add a _Predicate __pred and you're done here ✨

and the four _aux overloads, split by std::__false_type vs std::__true_type:

  • template<typename _InputIterator , typename _Predicate > constexpr bool __check_sorted_set_aux (const _InputIterator &, const _InputIterator &, _Predicate, std::__false_type) β€” double-underscore tag, predicate, unnamed params πŸ’€
  • template<typename _InputIterator > constexpr bool __check_sorted_set_aux (const _InputIterator &, const _InputIterator &, std::__false_type) β€” same minus the predicate πŸŽ€
  • template<typename _InputIterator , typename _Predicate > constexpr bool __check_sorted_set_aux (const _InputIterator &__first, const _InputIterator &__last, _Predicate __pred, std::__true_type) β€” __true_type version, and these params have names 🌸
  • template<typename _InputIterator > constexpr bool __check_sorted_set_aux (const _InputIterator &__first, const _InputIterator &__last, std::__true_type) β€” __true_type, no predicate, names present. true/false type split, iykyk πŸ’œ

__check_string πŸ“

  • template<typename _CharT , typename _Integer > const _CharT * __check_string (const _CharT *__s, _Integer __n, const char *__file, unsigned int __line, const char *__function) β€” the one with the _Integer __n. returns const _CharT * and passes along __file, unsigned int __line, __function πŸ”₯
  • template<typename _CharT > const _CharT * __check_string (const _CharT *__s, const char *__file, unsigned int __line, const char *__function) β€” no __n, everything else identical. same return type. pick your fighter 🫢

__check_valid_range βœ…

  • template<typename _InputIterator > _InputIterator __check_valid_range (const _InputIterator &__first, const _InputIterator &__last, const char *__file, unsigned int __line, const char *__function) β€” takes the range plus the __file / __line / __function trio and hands you back an _InputIterator. note it's not constexpr, ngl πŸ‘‘

__foreign_iterator & the aux saga 🌍

this family goes deep. aux, aux2, aux3, aux4. buckle up:

  • template<typename _Iterator , typename _Sequence , typename _Category , typename _InputIterator > bool __foreign_iterator (const _Safe_iterator< _Iterator, _Sequence, _Category > &__it, _InputIterator __other, _InputIterator __other_end) β€” the entry point: a _Safe_iterator plus __other / __other_end πŸ¦‹
  • template<typename _Iterator , typename _Sequence , typename _Category , typename _Integral > bool __foreign_iterator_aux (const _Safe_iterator< _Iterator, _Sequence, _Category > &, _Integral, _Integral, std::__true_type) β€” _Integral pair + std::__true_type. all unnamed except the tag πŸ’«
  • template<typename _Iterator , typename _Sequence , typename _Category , typename _InputIterator > bool __foreign_iterator_aux (const _Safe_iterator< _Iterator, _Sequence, _Category > &__it, _InputIterator __other, _InputIterator __other_end, std::__false_type) β€” the std::__false_type twin, with __it, __other, __other_end named ✨
  • template<typename _Iterator , typename _Sequence , typename _Category , typename _OtherIterator , typename _OtherSequence , typename _OtherCategory > bool __foreign_iterator_aux2 (const _Safe_iterator< _Iterator, _Sequence, _Category > &, const _Safe_iterator< _OtherIterator, _OtherSequence, _OtherCategory > &, const _Safe_iterator< _OtherIterator, _OtherSequence, _OtherCategory > &) β€” six template params, two _Safe_iterator types, everything unnamed. that third arg is the same type as the second, and yes that's on purpose 😭
  • template<typename _Iterator , typename _Sequence , typename _Category , typename _InputIterator > bool __foreign_iterator_aux2 (const _Safe_iterator< _Iterator, _Sequence, _Category > &__it, const _InputIterator &__other, const _InputIterator &__other_end) β€” the _InputIterator flavour, const refs, all named πŸŽ€
  • template<typename _Iterator , typename _Sequence , typename _Category , typename _OtherIterator > bool __foreign_iterator_aux2 (const _Safe_iterator< _Iterator, _Sequence, _Category > &__it, const _Safe_iterator< _OtherIterator, _Sequence, _Category > &__other, const _Safe_iterator< _OtherIterator, _Sequence, _Category > &) β€” same _Sequence and _Category as the first arg but a different _OtherIterator. third param unnamed again, she's shy πŸ’…
  • template<typename _Iterator , typename _Sequence , typename _Category , typename _InputIterator > bool __foreign_iterator_aux3 (const _Safe_iterator< _Iterator, _Sequence, _Category > &, const _InputIterator &, const _InputIterator &, std::__false_type) β€” aux3, std::__false_type, all unnamed 🌸
  • template<typename _Iterator , typename _Sequence , typename _Category , typename _InputIterator > bool __foreign_iterator_aux3 (const _Safe_iterator< _Iterator, _Sequence, _Category > &__it, const _InputIterator &__other, const _InputIterator &__other_end, std::__true_type) β€” aux3, std::__true_type, all named. matching set πŸŽ”
  • template<typename _Iterator , typename _Sequence , typename _Category > bool __foreign_iterator_aux4 (const _Safe_iterator< _Iterator, _Sequence, _Category > &,...) β€” variadic ellipsis ,.... yes with the comma. it's the "no idea what you gave me" catch-all and I respect it πŸ’€
  • template<typename _Iterator , typename _Sequence , typename _Category > bool __foreign_iterator_aux4 (const _Safe_iterator< _Iterator, _Sequence, _Category > &__it, const typename _Sequence::value_type *__other) β€” the typed one: __it plus const typename _Sequence::value_type *__other. note that typename is doing real work there πŸ‘€

__get_distance πŸ“

five overloads, and four of them return _Distance_traits< _Iterator >::__type (the fifth also does, just for the underlying _Iterator):

  • template<typename _Iterator > constexpr _Distance_traits< _Iterator >::__type __get_distance (_Iterator __lhs, _Iterator __rhs) β€” base case, two _Iterators named __lhs and __rhs πŸŽ€
  • template<typename _Iterator > constexpr _Distance_traits< _Iterator >::__type __get_distance (_Iterator __lhs, _Iterator __rhs, std::input_iterator_tag) β€” same args plus std::input_iterator_tag ✨
  • template<typename _Iterator > constexpr _Distance_traits< _Iterator >::__type __get_distance (_Iterator __lhs, _Iterator __rhs, std::random_access_iterator_tag) β€” same args plus std::random_access_iterator_tag πŸ¦‹
  • template<typename _Iterator > constexpr _Distance_traits< _Iterator >::__type __get_distance (const std::move_iterator< _Iterator > &__first, const std::move_iterator< _Iterator > &__last) β€” move-iterator flavour, __first / __last πŸŽ”
  • template<typename _Iterator > constexpr _Distance_traits< _Iterator >::__type __get_distance (const std::reverse_iterator< _Iterator > &__first, const std::reverse_iterator< _Iterator > &__last) β€” reverse flavour, __first / __last. all five are constexpr, we love consistency πŸ’œ

__is_irreflexive πŸͺž

just the two, both constexpr:

  • template<typename _Iterator > constexpr bool __is_irreflexive (_Iterator __it) β€” takes an _Iterator __it, bool out 🌈
  • template<typename _Iterator , typename _Pred > constexpr bool __is_irreflexive_pred (_Iterator __it, _Pred __pred) β€” now with a _Pred __pred in the mix πŸ’«

__unsafe πŸ”“

the "strip the safety off" family, five of them:

  • template<typename _Iterator > constexpr _Iterator __unsafe (_Iterator __it) β€” plain _Iterator in, _Iterator out, constexpr βœ…
  • template<typename _Iterator , typename _Sequence > _Iterator __unsafe (const _Safe_iterator< _Iterator, _Sequence > &__it) β€” _Safe_iterator plugged in, _Iterator comes out. not constexpr, don't @ me 🚨
  • template<typename _Iterator , typename _Sequence > _Iterator __unsafe (const _Safe_local_iterator< _Iterator, _Sequence > &__it) β€” the _Safe_local_iterator sibling. also not constexpr. yes both exist πŸ“
  • template<typename _Iterator > constexpr auto __unsafe (const std::move_iterator< _Iterator > &__it) -> decltype(std::make_move_iterator(__unsafe(__it.base()))) β€” move-iterator version with that whole decltype(std::make_move_iterator(__unsafe(__it.base()))) trailing return πŸŽ€
  • template<typename _Iterator > constexpr auto __unsafe (const std::reverse_iterator< _Iterator > &__it) -> decltype(std::__make_reverse_iterator(__unsafe(__it.base()))) β€” and the reverse version, but note this one says std::__make_reverse_iterator β€” two underscores, that's not a typo, keep it exactly 🌸

__valid_range 🌼

  • template<typename _InputIterator > constexpr bool __valid_range (_InputIterator __first, _InputIterator __last) β€” two _InputIterators by value, constexpr, bool out πŸ’–
  • template<typename _InputIterator > constexpr bool __valid_range (_InputIterator __first, _InputIterator __last, typename _Distance_traits< _InputIterator >::__type &__dist) β€” same plus a non-const reference to typename _Distance_traits< _InputIterator >::__type __dist. no const on that ref, bestie πŸ’…
  • template<typename _Iterator , typename _Sequence , typename _Category > bool __valid_range (const _Safe_iterator< _Iterator, _Sequence, β€” and here's where the page literally cuts off mid-signature 😭😭 that's not me being lazy, that is genuinely where it stops. do not invent the rest, just vibe with the cliffhanger πŸ’€

okay so picking up right where we left off, no intro needed bestie πŸ’– β€” this first line is literally just the tail end of an overload we already met (the __valid_range that takes two safe iterators and doesn't pass along a _Distance_traits thing):

           _Category > &, const _Safe_iterator< _Iterator, _Sequence, _Category
           > &)

and here's its twin, the one with the extra _Distance_traits< _Iterator >::__type & argument tacked on the end πŸ‘‡

       template<typename _Iterator , typename _Sequence , typename _Category >
           bool __valid_range (const _Safe_iterator< _Iterator, _Sequence,
           _Category > &, const _Safe_iterator< _Iterator, _Sequence, _Category
           > &, typename _Distance_traits< _Iterator >::__type &)

same vibe check, except for local iterators this time β€” _Safe_local_iterator, the whole two-of-them situation, first without the extra argument and then with it 🫢

       template<typename _Iterator , typename _Sequence > bool __valid_range
           (const _Safe_local_iterator< _Iterator, _Sequence > &, const
           _Safe_local_iterator< _Iterator, _Sequence > &)
       template<typename _Iterator , typename _Sequence > bool __valid_range
           (const _Safe_local_iterator< _Iterator, _Sequence > &, const
           _Safe_local_iterator< _Iterator, _Sequence > &, typename
           _Distance_traits< _Iterator >::__type &)

and then the wrappers, because std::move_iterator and std::reverse_iterator are extra like that ✨ both of these are constexpr, both take the extra _Distance_traits< _Iterator >::__type &__dist:

       template<typename _Iterator > constexpr bool __valid_range (const
           std::move_iterator< _Iterator > &__first, const std::move_iterator<
           _Iterator > &__last, typename _Distance_traits< _Iterator >::__type
           &__dist)
       template<typename _Iterator > constexpr bool __valid_range (const
           std::reverse_iterator< _Iterator > &__first, const
           std::reverse_iterator< _Iterator > &__last, typename
           _Distance_traits< _Iterator >::__type &__dist)

🌈 the __valid_range_aux era

okay so now we get the __valid_range_aux family and honestly there are six of them, so buckle up πŸŽ€ first up, the two that take std::__false_type and/or an std::input_iterator_tag / std::random_access_iterator_tag β€” all constexpr, all _InputIterator-flavoured:

       template<typename _InputIterator > constexpr bool __valid_range_aux
           (_InputIterator __first, _InputIterator __last, std::__false_type)
       template<typename _InputIterator > constexpr bool __valid_range_aux
           (_InputIterator __first, _InputIterator __last,
           std::input_iterator_tag)
       template<typename _InputIterator > constexpr bool __valid_range_aux
           (_InputIterator __first, _InputIterator __last,
           std::random_access_iterator_tag)

then the one with both the _Distance_traits< _InputIterator >::__type &__dist and the std::__false_type β€” she's got range and distance, main character energy fr πŸ’…

       template<typename _InputIterator > constexpr bool __valid_range_aux
           (_InputIterator __first, _InputIterator __last, typename
           _Distance_traits< _InputIterator >::__type &__dist,
           std::__false_type)

and the _Integral pair, which is <yellow>very demure, very mindful</yellow> β€” one plain three-argument version, one four-argument version that also carries _Distance_traits< _Integral >::__type &__dist, both constexpr, both taking std::__true_type:

       template<typename _Integral > constexpr bool __valid_range_aux
           (_Integral, _Integral, std::__true_type)
       template<typename _Integral > constexpr bool __valid_range_aux
           (_Integral, _Integral, typename _Distance_traits< _Integral
           >::__type &__dist, std::__true_type)

πŸ¦‹ string besties, assemble

okay so this next chunk is so nostalgic β€” it's the basic_string free functions and I'm obsessed 😭 first the two getlines: the plain one that reads into __str, and the one where you get to pick your own _CharT __delim (no default listed here, so you do have to pass it, iykyk):

       template<typename _CharT , typename _Traits , typename _Allocator >
           std::basic_istream< _CharT, _Traits > & getline (std::basic_istream<
           _CharT, _Traits > &__is, basic_string< _CharT, _Traits, _Allocator >
           &__str)
       template<typename _CharT , typename _Traits , typename _Allocator >
           std::basic_istream< _CharT, _Traits > & getline (std::basic_istream<
           _CharT, _Traits > &__is, basic_string< _CharT, _Traits, _Allocator >
           &__str, _CharT __delim)

and now the full comparison set β€” !=, <, <=, ==, >, >= β€” each one coming at you in all three flavours: const _CharT * on the left, const _CharT * on the right, or basic_string on both sides. every single one returns bool πŸ’–

       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator!= (const _CharT *__lhs, const basic_string< _CharT,
           _Traits, _Allocator > &__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator!= (const basic_string< _CharT, _Traits, _Allocator >
           &__lhs, const _CharT *__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator!= (const basic_string< _CharT, _Traits, _Allocator >
           &__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator< (const _CharT *__lhs, const basic_string< _CharT, _Traits,
           _Allocator > &__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator< (const basic_string< _CharT, _Traits, _Allocator > &__lhs,
           const _CharT *__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator< (const basic_string< _CharT, _Traits, _Allocator > &__lhs,
           const basic_string< _CharT, _Traits, _Allocator > &__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator<= (const _CharT *__lhs, const basic_string< _CharT,
           _Traits, _Allocator > &__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator<= (const basic_string< _CharT, _Traits, _Allocator >
           &__lhs, const _CharT *__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator<= (const basic_string< _CharT, _Traits, _Allocator >
           &__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator== (const _CharT *__lhs, const basic_string< _CharT,
           _Traits, _Allocator > &__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator== (const basic_string< _CharT, _Traits, _Allocator >
           &__lhs, const _CharT *__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator== (const basic_string< _CharT, _Traits, _Allocator >
           &__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator> (const _CharT *__lhs, const basic_string< _CharT, _Traits,
           _Allocator > &__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator> (const basic_string< _CharT, _Traits, _Allocator > &__lhs,
           const _CharT *__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator> (const basic_string< _CharT, _Traits, _Allocator > &__lhs,
           const basic_string< _CharT, _Traits, _Allocator > &__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator>= (const _CharT *__lhs, const basic_string< _CharT,
           _Traits, _Allocator > &__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator>= (const basic_string< _CharT, _Traits, _Allocator >
           &__lhs, const _CharT *__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator > bool
           operator>= (const basic_string< _CharT, _Traits, _Allocator >
           &__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)

πŸŽ€ the plus / stream / swap girlies

five whole operator+ overloads β€” _CharT on the left, const _CharT * on the left, _CharT on the right, const _CharT * on the right, and both-sides basic_string, all returning a fresh basic_string< _CharT, _Traits, _Allocator > πŸ’œ

       template<typename _CharT , typename _Traits , typename _Allocator >
           basic_string< _CharT, _Traits, _Allocator > operator+ (_CharT __lhs,
           const basic_string< _CharT, _Traits, _Allocator > &__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator >
           basic_string< _CharT, _Traits, _Allocator > operator+ (const _CharT
           *__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator >
           basic_string< _CharT, _Traits, _Allocator > operator+ (const
           basic_string< _CharT, _Traits, _Allocator > &__lhs, _CharT __rhs)
       template<typename _CharT , typename _Traits , typename _Allocator >
           basic_string< _CharT, _Traits, _Allocator > operator+ (const
           basic_string< _CharT, _Traits, _Allocator > &__lhs, const _CharT
           *__rhs)
       template<typename _CharT , typename _Traits , typename _Allocator >
           basic_string< _CharT, _Traits, _Allocator > operator+ (const
           basic_string< _CharT, _Traits, _Allocator > &__lhs, const
           basic_string< _CharT, _Traits, _Allocator > &__rhs)

and the stream operators β€” operator<< writes __str out to a std::basic_ostream, operator>> reads it in from a std::basic_istream, both returning the stream reference so you can chain them like a good little expression 🌸

       template<typename _CharT , typename _Traits , typename _Allocator >
           std::basic_ostream< _CharT, _Traits > & operator<<
           (std::basic_ostream< _CharT, _Traits > &__os, const basic_string<
           _CharT, _Traits, _Allocator > &__str)
       template<typename _CharT , typename _Traits , typename _Allocator >
           std::basic_istream< _CharT, _Traits > & operator>>
           (std::basic_istream< _CharT, _Traits > &__is, basic_string< _CharT,
           _Traits, _Allocator > &__str)

and closing out the free functions: swap, void, two basic_strings, that's it, that's the whole thing 🫢

       template<typename _CharT , typename _Traits , typename _Allocator > void
           swap (basic_string< _CharT, _Traits, _Allocator > &__lhs,
           basic_string< _CharT, _Traits, _Allocator > &__rhs)

✨ Detailed Description ✨

literally the whole point of this header, no cap:

GNU debug classes for public use.

that's it. that's the description. short, sweet, ate πŸ’…


πŸ¦‹ Typedef Documentation πŸ¦‹

two lil' string aliases, both of them just basic_string wearing a cute little __gnu_debug hat:

  • __gnu_debug::u16string β€” A string of char16_t. πŸ“
typedef basic_string<char16_t> __gnu_debug::u16string
  • __gnu_debug::u32string β€” A string of char32_t. ⭐
typedef basic_string<char32_t> __gnu_debug::u32string

πŸ‘‘ Enumeration Type Documentation πŸ‘‘

  • enum __gnu_debug::_Distance_precision β€” The precision to which we can calculate the distance between two iterators. like, how sure are we about the gap? this enum is the vibe check on that πŸ”₯

πŸ§ͺ FUNCTION DOCUMENTATION πŸ§ͺ

okay bestie, this is the function-by-function section, and it's basically the backstage pass to debug mode. every signature is here, every reference is here, and nothing is getting skipped. periodt. πŸ’…


🌟 __gnu_debug::__base 🌟

template<typename _Iterator > constexpr _Iterator __gnu_debug::__base (_Iterator __it) [inline],  [constexpr]

This is the helper that extracts the base iterator of a random access safe iterator so debug mode doesn't hit your performance as hard. It's limited to random access iterators because that's the only category where you can check for correct iterator order in the __valid_range function thanks to the < operator. slay for valid ranges only, iykyk.

Referenced by: __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_M_before_dereferenceable().


🌟 __gnu_debug::__check_singular 🌟

template<typename _Tp > constexpr bool __gnu_debug::__check_singular (_Tp *const & __ptr) [inline],  [constexpr]

Short and iconic: non-NULL pointers are nonsingular. that's the whole vibe. ✨


🌟 __gnu_debug::__check_singular_aux 🌟

bool __gnu_debug::__check_singular_aux (const _Safe_iterator_base * __x) [inline]

Iterators that derive from _Safe_iterator_base can be figured out as singular or non-singular. bestie said "let the base class handle it."

References: __gnu_debug::_Safe_iterator_base::_M_singular().


🌟 __gnu_debug::__check_string β€” overload 1 🌟

template<typename _CharT , typename _Integer > const _CharT * __gnu_debug::__check_string (const _CharT * __s, _Integer __n, const char * __file, unsigned int __line, const char * __function) [inline]

Checks that __s is non-NULL or __n == 0, and then returns __s. lowkey a little bodyguard for your string. 🫢


🌟 __gnu_debug::__check_string β€” overload 2 🌟

template<typename _CharT > const _CharT * __gnu_debug::__check_string (const _CharT * __s, const char * __file, unsigned int __line, const char * __function) [inline]

Checks that __s is non-NULL and then returns __s. same energy, no __n this time. πŸ’–


🌟 __gnu_debug::__foreign_iterator_aux2 β€” overload 1 🌟

template<typename _Iterator , typename _Sequence , typename _Category , typename _OtherIterator , typename _OtherSequence , typename _OtherCategory > bool __gnu_debug::__foreign_iterator_aux2 (const _Safe_iterator< _Iterator, _Sequence, _Category > &, const _Safe_iterator< _OtherIterator, _OtherSequence, _OtherCategory > &, const _Safe_iterator< _OtherIterator, _OtherSequence, _OtherCategory > &) [inline]

This overload handles debug iterators from different types of container. different container types? bestie we're checking the vibes across the whole friend group. 🌈


🌟 __gnu_debug::__foreign_iterator_aux2 β€” overload 2 🌟

template<typename _Iterator , typename _Sequence , typename _Category , typename _OtherIterator > bool __gnu_debug::__foreign_iterator_aux2 (const _Safe_iterator< _Iterator, _Sequence, _Category > & __it, const _Safe_iterator< _OtherIterator, _Sequence, _Category > & __other, const _Safe_iterator< _OtherIterator, _Sequence, _Category > &) [inline]

This one handles debug iterators from the same type of container. same container type, still doing the aux2 thing. πŸ’š


🌟 __gnu_debug::__get_distance 🌟

template<typename _Iterator > constexpr _Distance_traits< _Iterator >::__type __gnu_debug::__get_distance (_Iterator __lhs, _Iterator __rhs, std::random_access_iterator_tag) [inline],  [constexpr]

Determine the distance between two iterators with some known precision. not me measuring the emotional distance between __lhs and __rhs πŸ˜­πŸ“


🌟 __gnu_debug::__valid_range β€” overload 1 🌟

template<typename _InputIterator > constexpr bool __gnu_debug::__valid_range (_InputIterator __first, _InputIterator __last, typename _Distance_traits< _InputIterator >::__type & __dist) [inline],  [constexpr]

We don't know what these iterators are, or if they're even iterators at all β€” we may get an integral type for InputIterator β€” so this checks if they're integral and passes them on to the next phase otherwise. very "figure out what we're dealing with" energy. πŸ•΅οΈβ€β™€οΈ

References: __valid_range_aux().


🌟 __gnu_debug::__valid_range β€” overload 2 🌟

template<typename _Iterator , typename _Sequence , typename _Category > bool __gnu_debug::__valid_range (const _Safe_iterator< _Iterator, _Sequence, _Category > & __first, const _Safe_iterator< _Iterator, _Sequence, _Category > & __last, typename _Distance_traits< _Iterator >::__type & __dist) [inline]

Safe iterators know how to check if they form a valid range. they're self-aware like that. πŸ’…


🌟 __gnu_debug::__valid_range β€” overload 3 🌟

template<typename _Iterator , typename _Sequence > bool __gnu_debug::__valid_range (const _Safe_local_iterator< _Iterator, _Sequence > & __first, const _Safe_local_iterator< _Iterator, _Sequence > & __last, typename _Distance_traits< _Iterator >::__type & __dist_info) [inline]

Safe local iterators also know how to check if they form a valid range. local icons staying valid. πŸŽ€


🌟 __gnu_debug::__valid_range_aux β€” overload 1 🌟

template<typename _InputIterator > constexpr bool __gnu_debug::__valid_range_aux (_InputIterator __first, _InputIterator __last, std::__false_type) [inline],  [constexpr]

We have iterators, so this figures out what kind of iterators they are to see if we can check the range ahead of time. ahead-of-time range check? highkey organized. ✨

References: std::__iterator_category(), and __valid_range_aux().


🌟 __gnu_debug::__valid_range_aux β€” overload 2 🌟

template<typename _Integral > constexpr bool __gnu_debug::__valid_range_aux (_Integral, _Integral, std::__true_type) [inline],  [constexpr]

This one says that integral types are a valid range, and defers to other routines to figure out what to do with integral types instead of iterators. integral types understood the assignment. πŸ“

Referenced by: __valid_range(), and __valid_range_aux().


✍️ AUTHOR ✍️

Generated automatically by Doxygen for libstdc++ from the source code. no cap, the robot wrote it. πŸ€–πŸ’–


footer vibe check: source/version is libstdc++, and the page tag is __gnu_debug(3cxx). generated automatically by Doxygen for libstdc++ from the source code β€” bye bestie, stay valid πŸ’…πŸŒˆ