__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 forforward_listbecause of thebefore_beginiterator. 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_sequencebut with a special_M_invalidate_allimplementation 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β classstd::basic_stringwith safety/checking/debug instrumentation. the string, but with the safety checks on. π
π¦ Typedefs π¦
typedef basic_string< char > stringβ no extra blurb, just thecharstring typedef living her life. β¨typedef basic_string< char16_t > u16stringβ a string ofchar16_t. πtypedef basic_string< char32_t > u32stringβ a string ofchar32_t. πtypedef basic_string< wchar_t > wstringβ no extra description in the page. she's just here with herwchar_tself. πΈ
π 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_Iteratorwalks in,_Iteratorwalks out, very demure β¨template<typename _Iterator , typename _Sequence > _Iterator __base (const _Safe_iterator< _Iterator, _Sequence, std::random_access_iterator_tag > &__it)β the_Safe_iteratorflavour, and it's specifically taggedstd::random_access_iterator_tag. note there's noconstexpron 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())))β thestd::move_iteratorflavour, and the return type is that wholedecltype(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 astd::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+_Sizeflavour. 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 thestd::pair< _Diff, _Distance_precision > &and anint. also unnamed params, alsoconstexprπ«template<typename _Iterator , typename _Sequence , typename _Category , typename _Size > bool __can_advance (const _Safe_iterator< _Iterator, _Sequence, _Category > &, _Size)β the_Safe_iteratortake,_Categoryincluded,_Sizeincluded, and heads up: notconstexprthis 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 > &+intcombo. noconstexpr, 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,__itand__ngot names this time,constexpris 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+__ndeal, stillconstexprπΈ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)β thelowerone, 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 __predbolted on._ForwardIteratoris 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)β theuppertwin 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 theconstis 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_baseaux, named__x, and it is not a template and notconstexprπ¨bool __check_singular_aux (const class _Safe_iterator_base *)β okay so yes, this looks like the same thing again withclassin front and no parameter name. that is fr fr what's printed, do not "clean it up" πbool __check_singular_aux (const void *)β and theconst 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,constrefs 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, allconstexpr, 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 justconst _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 __predand 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_typeversion, 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. returnsconst _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/__functiontrio and hands you back an_InputIterator. note it's notconstexpr, 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_iteratorplus__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)β_Integralpair +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)β thestd::__false_typetwin, with__it,__other,__other_endnamed β¨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_iteratortypes, 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_InputIteratorflavour, 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_Sequenceand_Categoryas 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:__itplusconst typename _Sequence::value_type *__other. note thattypenameis 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__lhsand__rhsπtemplate<typename _Iterator > constexpr _Distance_traits< _Iterator >::__type __get_distance (_Iterator __lhs, _Iterator __rhs, std::input_iterator_tag)β same args plusstd::input_iterator_tagβ¨template<typename _Iterator > constexpr _Distance_traits< _Iterator >::__type __get_distance (_Iterator __lhs, _Iterator __rhs, std::random_access_iterator_tag)β same args plusstd::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 areconstexpr, 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 __predin the mix π«
__unsafe π
the "strip the safety off" family, five of them:
template<typename _Iterator > constexpr _Iterator __unsafe (_Iterator __it)β plain_Iteratorin,_Iteratorout,constexprβtemplate<typename _Iterator , typename _Sequence > _Iterator __unsafe (const _Safe_iterator< _Iterator, _Sequence > &__it)β_Safe_iteratorplugged in,_Iteratorcomes out. notconstexpr, don't @ me π¨template<typename _Iterator , typename _Sequence > _Iterator __unsafe (const _Safe_local_iterator< _Iterator, _Sequence > &__it)β the_Safe_local_iteratorsibling. also notconstexpr. 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 wholedecltype(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 saysstd::__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 totypename _Distance_traits< _InputIterator >::__type __dist. noconston 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 ofchar16_t. π
typedef basic_string<char16_t> __gnu_debug::u16string
__gnu_debug::u32stringβ A string ofchar32_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 π
π
π¦ where this page comes from
- debian trixie: libstdc++-14-doc 14.2.0-19
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- ubuntu noble: libstdc++-14-doc 14.2.0-4ubuntu2~24.04.1
- 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