__GNU_DEBUG::BASIC_STRING(3cxx)
π NAME π
Okay so this is the __gnu_debug::ba...s, _Allocator >(3cxx) manual page, and the main character is __gnu_debug::basic_string< _CharT, _Traits, _Allocator >. Itβs the class std::basic_string with safety/checking/debug instrumentation. No cap, bestie β itβs giving string energy with debug instrumentation in the mix. π
β¨ SYNOPSIS β¨
First things first, include the header:
#include <string>
It inherits from __gnu_debug::_Safe_container< _SafeContainer, _Alloc, _SafeBase, _IsCxx11AllocatorAware > and std::basic_string< _CharT, _Traits, _Alloc >. Slay. π¦
π«Ά Public Types π«Ά
allocator_typeβtypedef _Allocator allocator_type; thatβs the allocator type, periodt. πconst_iteratorβtypedef __gnu_debug::_Safe_iterator< typename _Base::const_iterator, basic_string > const_iterator; the checked const iterator vibe. β¨const_pointerβtypedef _Base::const_pointer const_pointer; the const pointer type. πconst_referenceβtypedef _Base::const_reference const_reference; the const reference type. πΈconst_reverse_iteratorβtypedef std::reverse_iterator< const_iterator > const_reverse_iterator; reverse iterator but const, iconic. π¦difference_typeβtypedef _Base::difference_type difference_type; the difference type. πiteratorβtypedef __gnu_debug::_Safe_iterator< typename _Base::iterator, basic_string > iterator; the checked iterator, lowkey essential. π₯pointerβtypedef _Base::pointer pointer; the pointer type. βreferenceβtypedef _Base::reference reference; the reference type. π«Άreverse_iteratorβtypedef std::reverse_iterator< iterator > reverse_iterator; reverse iterator energy, fr fr. πsize_typeβtypedef _Base::size_type size_type; the size type. πtraits_typeβtypedef _Traits traits_type; the traits type. π§value_typeβtypedef _Traits::char_type value_type; the character type, and yes itβs giving main-character energy. π
πΈ Public Member Functions πΈ
okay bestie, this is the whole entire menu of what she can do π every overload, every default argument, nothing skipped, nothing merged. grab a lil snack, we're going through all of it.
basic_string (_Base &&__base) noexceptβ the_Baservalue-ref constructor, and she'snoexceptabout it β¨template<typename _InputIterator > basic_string (_InputIterator __begin, _InputIterator __end, const _Allocator &__a=_Allocator())β build her from an iterator range, allocator defaults to_Allocator()basic_string (basic_string &&)=defaultβ the move constructor, defaulted, no notes πbasic_string (basic_string &&__s, const _Allocator &__a) noexcept(std::is_nothrow_constructible< _Base, _Base, const _Allocator & >::value)β move with an allocator, and thenoexceptis that wholeis_nothrow_constructibleexpression, iykykbasic_string (const _Allocator &__a) noexceptβ just an allocator, that's it,noexceptbasic_string (const _Base &__base)β the_Baseconst-ref constructorbasic_string (const _CharT *__s, const _Allocator &__a=_Allocator())β from a_CharTpointer, allocator defaultsbasic_string (const _CharT *__s, size_type __n, const _Allocator &__a=_Allocator())β pointer plus a count__n, allocator defaultsbasic_string (const basic_string &)=defaultβ copy constructor, defaulted π«Άbasic_string (const basic_string &__s, const _Allocator &__a)β copy, but you're bringing your own allocatorbasic_string (const basic_string &__str, size_type __pos, size_type __n=_Base::npos, const _Allocator &__a=_Allocator())β the substring constructor;__ndefaults to_Base::npos, allocator defaults toobasic_string (size_type __n, _CharT __c, const _Allocator &__a=_Allocator())β__ncopies of character__c, allocator defaultsbasic_string (std::initializer_list< _CharT > __l, const _Allocator &__a=_Allocator())β from aninitializer_list< _CharT >, allocator defaultstemplate<typename _Operation > void __resize_and_overwrite (size_type __n, _Operation __op)β non-standard version ofresize_and_overwritefor C++11 and above, she's a little special like that πconst _Base & _M_base () const noexceptβ const ref to_Base,noexcept_Base & _M_base () noexceptβ non-const ref to_Base,noexcepttemplate<typename _InputIterator > basic_string< _CharT, _Traits, _Alloc > & _M_replace_dispatch (iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2, __false_type)β the_M_replace_dispatchinternal, taking two iterators, two_InputIterators and a__false_typetemplate<typename _InIterator > _CharT * _S_construct (_InIterator __beg, _InIterator __end, const _Alloc &__a, forward_iterator_tag)β_S_construct, returns_CharT *, takes a range, an allocator and aforward_iterator_tag
template<typename _InputIterator > basic_string & append (_InputIterator __first, _InputIterator __last)β append an iterator rangebasic_string & append (const _CharT *__s)β append a_CharTpointerbasic_string & append (const _CharT *__s, size_type __n)β append__ncharacters from that pointertemplate<typename _Tp > _If_sv< _Tp, basic_string & > append (const _Tp &__svt)β append astring_viewβ¨template<typename _Tp > _If_sv< _Tp, basic_string & > append (const _Tp &__svt, size_type __pos, size_type __n=npos)β append a range of characters from astring_view,__ndefaults tonposbasic_string & append (const basic_string &__str)β append a string to this string πbasic_string & append (const basic_string &__str)β yes she's listed again with no description, we don't make the rules πbasic_string & append (const basic_string &__str, size_type __pos, size_type __n)β no description on this one either, just vibesbasic_string & append (const basic_string &__str, size_type __pos, size_type __n=npos)β append a substring,__ndefaults tonposbasic_string & append (initializer_list< _CharT > __l)β append aninitializer_listof characters πbasic_string & append (size_type __n, _CharT __c)β append__nof character__c
template<typename _InputIterator > basic_string & assign (_InputIterator __first, _InputIterator __last)β assign from an iterator rangebasic_string & assign (basic_string &&__str) noexcept(allocator_traits< _Alloc >::is_always_equal::value)β set value to contents of another string, move-style,noexceptdepends onallocator_traits< _Alloc >::is_always_equal::valuebasic_string & assign (basic_string &&__x) noexcept(noexcept(std::declval< _Base & >().assign(std::move(__x))))β the other move assign, with that whole nestednoexcept(noexcept(std::declval< _Base & >().assign(std::move(__x))))situationbasic_string & assign (const _CharT *__s)β assign from a_CharTpointerbasic_string & assign (const _CharT *__s, size_type __n)β assign__nchars from a pointertemplate<typename _Tp > _If_sv< _Tp, basic_string & > assign (const _Tp &__svt)β set value from astring_viewtemplate<typename _Tp > _If_sv< _Tp, basic_string & > assign (const _Tp &__svt, size_type __pos, size_type __n=npos)β set value from a range of characters in astring_view,__ndefaults tonposbasic_string & assign (const basic_string &__str)β set value to contents of another stringbasic_string & assign (const basic_string &__str, size_type __pos, size_type __n)β no description, just the overloadbasic_string & assign (const basic_string &__str, size_type __pos, size_type __n=npos)β set value to a substring of a string,__ndefaults tonposbasic_string & assign (const basic_string &__x)β plain copy assign, no description listedbasic_string & assign (size_type __n, _CharT __c)β__ncopies of__cbasic_string & assign (std::initializer_list< _CharT > __l)β assign from aninitializer_list< _CharT >
reference at (size_type __n)β provides access to the data contained in the string πconst_reference at (size_type __n) constβ same deal, const flavor, provides access to the data contained in the stringreference back ()β the back element, non-constconst_reference back () const noexceptβ back element, const,noexceptiterator begin ()β iterator to the startconst_iterator begin () const noexceptβ const iterator to the start,noexceptconst _CharT * c_str () const noexceptβ theconst _CharT *,noexcept, classicsize_type capacity () const noexceptβ how much she can hold,noexceptconst_iterator cbegin () const noexceptβ const begin,noexceptconst_iterator cend () const noexceptβ const end,noexceptvoid clear ()β clears her out
int compare (const _CharT *__s) const noexceptβ compare to a C string,noexcept, returnsintconstexpr int compare (const _CharT *__s) const noexceptβ theconstexprversion of the C-string comparetemplate<typename _Tp > _If_sv< _Tp, int > compare (const _Tp &__svt) const noexcept(is_same< _Tp, __sv_type >::value)β compare to astring_view,noexceptpowered byis_same< _Tp, __sv_type >::valueint compare (const basic_string &__str) constβ compare to a stringint compare (const basic_string &__str) constβ compare to a string, part two, the docs really said "again" πtemplate<typename _Tp > _If_sv< _Tp, int > compare (size_type __pos, size_type __n, const _Tp &__svt) const noexcept(is_same< _Tp, __sv_type >::value)β compare to astring_view, with__posand__nint compare (size_type __pos, size_type __n, const basic_string &__str) constβ compare substring to a stringint compare (size_type __pos, size_type __n, const basic_string &__str) constβ same line again, she's an icon, she repeats herself β¨int compare (size_type __pos, size_type __n1, const _CharT *__s) constβ compare substring to a C stringint compare (size_type __pos, size_type __n1, const _CharT *__s, size_type __n2) constβ compare substring against a character arrayconstexpr int compare (size_type __pos1, size_type __n1, const _CharT *__s) constβconstexprsubstring-vs-C-string, note the__pos1/__n1namingconstexpr int compare (size_type __pos1, size_type __n1, const _CharT *__s, size_type __n2) constβconstexpr, plus__n2template<typename _Tp > _If_sv< _Tp, int > compare (size_type __pos1, size_type __n1, const _Tp &__svt, size_type __pos2, size_type __n2=npos) const noexcept(is_same< _Tp, __sv_type >::value)β compare to astring_viewwith__pos1,__n1,__pos2, and__n2=nposint compare (size_type __pos1, size_type __n1, const basic_string &__str, size_type __pos2, size_type __n2=npos) constβ compare substring to a substringint compare (size_type __pos1, size_type __n1, const basic_string &__str, size_type __pos2, size_type __n2=npos) constβ compare substring to a substring, listed twice, periodt πsize_type copy (_CharT *__s, size_type __n, size_type __pos=0) constβ copy out__nchars into__sstarting at__pos, which defaults to0const_reverse_iterator crbegin () const noexceptβ const reverse begin,noexceptconst_reverse_iterator crend () const noexceptβ const reverse end,noexceptconst _CharT * data () const noexceptβ const pointer to the data,noexcept_CharT * data () noexceptβ return non-const pointer to contents π₯bool empty () const noexceptβ is she empty,noexcept, returnsbooliterator end ()β iterator to the endconst_iterator end () const noexceptβ const iterator to the end,noexcept
bool ends_with (_CharT __x) const noexceptβ does she end with character__xbool ends_with (basic_string_view< _CharT, _Traits > __x) const noexceptβ ends with thatbasic_string_view< _CharT, _Traits >bool ends_with (const _CharT *__x) const noexceptβ ends with a_CharTpointeriterator erase (__const_iterator __first, __const_iterator __last)β erase from__firstto__last, note the__const_iteratorspellingiterator erase (__const_iterator __position)β erase at__position,__const_iteratoragainiterator erase (iterator __first, iterator __last)β remove a range of charactersiterator erase (iterator __position)β remove one characterbasic_string & erase (size_type __pos=0, size_type __n=_Base::npos)β the index version,__posdefaults to0,__ndefaults to_Base::npos
size_type find (_CharT __c, size_type __pos=0) const noexceptβ find position of a character,__posdefaults to0size_type find (const _CharT *__s, size_type __pos, size_type __n) const noexceptβ find position of a C substring, needs__posand__nconstexpr size_type find (const _CharT *__s, size_type __pos, size_type __n) const noexceptβ theconstexprversion of that same C-substring findsize_type find (const _CharT *__s, size_type __pos=0) const noexceptβ find position of a C string,__posdefaults to0constexpr size_type find (const _CharT *__s, size_type __pos=0) const noexceptβconstexprC-string find,__pos=0template<typename _Tp > _If_sv< _Tp, size_type > find (const _Tp &__svt, size_type __pos=0) const noexcept(is_same< _Tp, __sv_type >::value)β find position of astring_view,noexcept(is_same< _Tp, __sv_type >::value)size_type find (const basic_string &__str, size_type __pos=0) const noexceptβ find position of a stringsize_type find (const basic_string &__str, size_type __pos=0) const noexceptβ find position of a string, again, because of course π¦size_type find_first_not_of (_CharT __c, size_type __pos=0) const noexceptβ find position of a different charactersize_type find_first_not_of (const _CharT *__s, size_type __pos, size_type __n) const noexceptβ find position of a character not in a C substringconstexpr size_type find_first_not_of (const _CharT *__s, size_type __pos, size_type __n) const noexceptβconstexprversion of that onesize_type find_first_not_of (const _CharT *__s, size_type __pos=0) const noexceptβ find position of a character not in a C string,__pos=0constexpr size_type find_first_not_of (const _CharT *__s, size_type __pos=0) const noexceptβ theconstexprtwin,__pos=0template<typename _Tp > _If_sv< _Tp, size_type > find_first_not_of (const _Tp &__svt, size_type __pos=0) const noexcept(is_same< _Tp, __sv_type >::value)β find position of a character not in astring_viewsize_type find_first_not_of (const basic_string &__str, size_type __pos=0) const noexceptβ find position of a character not in stringsize_type find_first_not_of (const basic_string &__str, size_type __pos=0) const noexceptβ find position of a character not in string, duplicated, she said copy-paste slay π
size_type find_first_of (_CharT __c, size_type __pos=0) const noexceptβ find position of a charactersize_type find_first_of (const _CharT *__s, size_type __pos, size_type __n) const noexceptβ find position of a character of a C substringconstexpr size_type find_first_of (const _CharT *__s, size_type __pos, size_type __n) const noexceptβconstexprflavor of that same onesize_type find_first_of (const _CharT *__s, size_type __pos=0) const noexceptβ find position of a character of a C stringconstexpr size_type find_first_of (const _CharT *__s, size_type __pos=0) const noexceptβconstexpr, C string,__pos=0template<typename _Tp > _If_sv< _Tp, size_type > find_first_of (const _Tp &__svt, size_type __pos=0) const noexcept(is_same< _Tp, __sv_type >::value)β find position of a character of astring_viewsize_type find_first_of (const basic_string &__str, size_type __pos=0) const noexceptβ find position of a character of stringsize_type find_first_of (const basic_string &__str, size_type __pos=0) const noexceptβ find position of a character of string, and yes, she's here twice π
size_type find_last_not_of (_CharT __c, size_type __pos=npos) const noexceptβ find last position of a different character,__posdefaults tonposthis time, not0size_type find_last_not_of (const _CharT *__s, size_type __pos, size_type __n) const noexceptβ find last position of a character not in a C substringconstexpr size_type find_last_not_of (const _CharT *__s, size_type __pos, size_type __n) const noexceptβconstexprversion of that last-not-of call π
okay so the overload parade continues π no skipping, bestie, we're reading every single one of these, hydrate first π§
constexpr size_type find_last_not_of (const _CharT *__s, size_type __pos=_Base::npos) const noexceptβ no blurb in the docs for this one, she's mysterious πsize_type find_last_not_of (const _CharT *__s, size_type __pos=npos) const noexceptβ Find last position of a character not in C string. like, "where's the last char that's not in this C string" energy πtemplate<typename _Tp > _If_sv< _Tp, size_type > find_last_not_of (const _Tp &__svt, size_type __pos=npos) const noexcept(is_same< _Tp, __sv_type >::value)β same hunt, but the "not in here" thing is a string_view πΈsize_type find_last_not_of (const basic_string &__str, size_type __pos=npos) const noexceptβ Find last position of a character not in string.size_type find_last_not_of (const basic_string &__str, size_type __pos=npos) const noexceptβ and yeah it's listed twice in the docs, we don't ask questions πsize_type find_last_of (_CharT __c, size_type __pos=npos) const noexceptβ Find last position of a character. last time this char shows up, go π―size_type find_last_of (const _CharT *__s, size_type __pos, size_type __n) const noexceptβ Find last position of a character of C substring.constexpr size_type find_last_of (const _CharT *__s, size_type __pos, size_type __n) const noexceptβ theconstexprtwin, no blurb supplied β¨constexpr size_type find_last_of (const _CharT *__s, size_type __pos=_Base::npos) const noexceptβ also no blurb, just vibes π¦size_type find_last_of (const _CharT *__s, size_type __pos=npos) const noexceptβ Find last position of a character of C string.template<typename _Tp > _If_sv< _Tp, size_type > find_last_of (const _Tp &__svt, size_type __pos=npos) const noexcept(is_same< _Tp, __sv_type >::value)β Find last position of a character of string. but the string is a string_view π«Άsize_type find_last_of (const basic_string &__str, size_type __pos=npos) const noexceptβ Find last position of a character of string.size_type find_last_of (const basic_string &__str, size_type __pos=npos) const noexceptβ yes bestie, twice again, iconic behaviour honestly π
reference front ()β the docs give us nothing here πconst_reference front () const noexceptβ const flavour, also un-blurbedallocator_type get_allocator () const noexceptβ Return copy of allocator used to construct this string. she remembers who made her π₯Ή
the insert era, prepare yourself π
iterator insert (__const_iterator __p, _CharT __c)β no description given πtemplate<typename _InputIterator > iterator insert (__const_iterator __p, _InputIterator __first, _InputIterator __last)β also no descriptioniterator insert (const_iterator __p, size_type __n, _CharT __c)β nope, none here eitheriterator insert (const_iterator __p, std::initializer_list< _CharT > __l)β still none πiterator insert (iterator __p, _CharT __c)β Insert one character. one (1) lil guy π£template<class _InputIterator > void insert (iterator __p, _InputIterator __beg, _InputIterator __end)β Insert a range of characters. whole squad, in they go πvoid insert (iterator __p, initializer_list< _CharT > __l)β Insert an initializer_list of characters.void insert (iterator __p, size_type __n, _CharT __c)β Insert multiple characters. spam that char, respectfully πbasic_string & insert (size_type __pos, const _CharT *__s)β undocumented, she's a mystery π΅οΈββοΈbasic_string & insert (size_type __pos, const _CharT *__s, size_type __n)β also no blurbtemplate<typename _Tp > _If_sv< _Tp, basic_string & > insert (size_type __pos, const _Tp &__svt)β Insert a string_view. β¨basic_string & insert (size_type __pos, size_type __n, _CharT __c)β no blurb, moving on πββοΈtemplate<typename _Tp > _If_sv< _Tp, basic_string & > insert (size_type __pos1, const _Tp &__svt, size_type __pos2, size_type __n=npos)β Insert a string_view. again, but with a position inside the view too πͺbasic_string & insert (size_type __pos1, const basic_string &__str)β Insert value of a string.basic_string & insert (size_type __pos1, const basic_string &__str)β listed twice, we move πbasic_string & insert (size_type __pos1, const basic_string &__str, size_type __pos2, size_type __n)β no blurb πΈbasic_string & insert (size_type __pos1, const basic_string &__str, size_type __pos2, size_type __n=npos)β Insert a substring. a little slice of her π°
size_type length () const noexceptβ Returns the number of characters in the string, not including any null-termination. the real count, no sneaky terminator πsize_type max_size () const noexceptβ Returns thesize()of the largest possible string. her absolute limit, respectfully π₯
operator __sv_type () const noexceptβ Convert to a string_view. glow-up into a view π¦
operator city, we're literally living here now ποΈ
basic_string & operator+= (_CharT __c)β no blurb πbasic_string & operator+= (const _CharT *__s)β none here eithertemplate<typename _Tp > _If_sv< _Tp, basic_string & > operator+= (const _Tp &__svt)β Append a string_view. πbasic_string & operator+= (const basic_string &__str)β Append a string to this string. girl math: string + string = longer string β¨basic_string & operator+= (const basic_string &__str)β twice, slay πbasic_string & operator+= (std::initializer_list< _CharT > __l)β no description πbasic_string & operator= (_CharT __c)β undocumentedbasic_string & operator= (basic_string &&)=defaultβ also undocumented, note the=defaultπ«Άbasic_string & operator= (const _CharT *__s)β still nothingbasic_string & operator= (const basic_string &)=defaultβ=defaultagain, that's all we know πbasic_string & operator= (std::initializer_list< _CharT > __l)β no blurb, bye πreference operator[] (size_type __pos)β no description given π―const_reference operator[] (size_type __pos) const noexceptβ const one, also no description
void pop_back ()β undocumented πvoid push_back (_CharT __c)β also undocumented, cute little pair tho π«Άreverse_iterator rbegin ()β no blurb πconst_reverse_iterator rbegin () const noexceptβ nonereverse_iterator rend ()β noneconst_reverse_iterator rend () const noexceptβ none, ok moving πββοΈ
the replace cinematic universe (this is the big one, stay with me) π
template<typename _InputIterator > basic_string & replace (__const_iterator __i1, __const_iterator __i2, _InputIterator __j1, _InputIterator __j2)β undocumented πbasic_string & replace (__const_iterator __i1, __const_iterator __i2, const _CharT *__s)β nonebasic_string & replace (__const_iterator __i1, __const_iterator __i2, const _CharT *__s, size_type __n)β nonebasic_string & replace (__const_iterator __i1, __const_iterator __i2, const basic_string &__str)β nonebasic_string & replace (__const_iterator __i1, __const_iterator __i2, size_type __n, _CharT __c)β nonebasic_string & replace (__const_iterator __i1, __const_iterator __i2, std::initializer_list< _CharT > __l)β none πΈtemplate<typename _Tp > _If_sv< _Tp, basic_string & > replace (const_iterator __i1, const_iterator __i2, const _Tp &__svt)β Replace range of characters with string_view. β¨basic_string & replace (iterator __i1, iterator __i2, _CharT *__k1, _CharT *__k2)β no blurb, note these are non-const pointers πtemplate<class _InputIterator > basic_string & replace (iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2)β Replace range of characters with range. trade a range for a range, fair trade π€basic_string & replace (iterator __i1, iterator __i2, const _CharT *__k1, const _CharT *__k2)β undocumentedbasic_string & replace (iterator __i1, iterator __i2, const _CharT *__s)β Replace range of characters with C string.basic_string & replace (iterator __i1, iterator __i2, const _CharT *__s, size_type __n)β Replace range of characters with C substring.basic_string & replace (iterator __i1, iterator __i2, const basic_string &__str)β Replace range of characters with string.basic_string & replace (iterator __i1, iterator __i2, const_iterator __k1, const_iterator __k2)β no descriptionbasic_string & replace (iterator __i1, iterator __i2, initializer_list< _CharT > __l)β Replace range of characters with initializer_list.basic_string & replace (iterator __i1, iterator __i2, iterator __k1, iterator __k2)β no blurb πbasic_string & replace (iterator __i1, iterator __i2, size_type __n, _CharT __c)β Replace range of characters with multiple characters. πtemplate<typename _Tp > _If_sv< _Tp, basic_string & > replace (size_type __pos, size_type __n, const _Tp &__svt)β Replace range of characters with string_view. β¨basic_string & replace (size_type __pos, size_type __n, const basic_string &__str)β Replace characters with value from another string. borrowing her fit πbasic_string & replace (size_type __pos, size_type __n1, const _CharT *__s)β undocumentedbasic_string & replace (size_type __pos, size_type __n1, const _CharT *__s, size_type __n2)β undocumentedbasic_string & replace (size_type __pos, size_type __n1, size_type __n2, _CharT __c)β undocumented πtemplate<typename _Tp > _If_sv< _Tp, basic_string & > replace (size_type __pos1, size_type __n1, const _Tp &__svt, size_type __pos2, size_type __n2=npos)β Replace range of characters with string_view. the deluxe version πbasic_string & replace (size_type __pos1, size_type __n1, const basic_string &__str)β no blurbbasic_string & replace (size_type __pos1, size_type __n1, const basic_string &__str, size_type __pos2, size_type __n2)β no blurbbasic_string & replace (size_type __pos1, size_type __n1, const basic_string &__str, size_type __pos2, size_type __n2=npos)β Replace characters with value from another string. π
void reserve ()β Equivalent toshrink_to_fit(). yes, the zero-arg one does that, read it twice bestie πvoid reserve (size_type __res_arg)β Attempt to preallocate enough memory for specified number of characters. grabbing seats before the squad arrives πͺvoid resize (size_type __n)β no description given πvoid resize (size_type __n, _CharT __c)β also nonesize_type rfind (_CharT __c, size_type __pos=npos) const noexceptβ Find last position of a character. reverse search, go backwards babe πconstexpr size_type rfind (const _CharT *__s, size_type __pos, size_type __n) constβ undocumented β¨size_type rfind (const _CharT *__s, size_type __pos, size_type __n) const noexceptβ Find last position of a C substring.constexpr size_type rfind (const _CharT *__s, size_type __pos=_Base::npos) constβ undocumentedsize_type rfind (const _CharT *__s, size_type __pos=npos) const noexceptβ Find last position of a C string.template<typename _Tp > _If_sv< _Tp, size_type > rfind (const _Tp &__svt, size_type __pos=npos) const noexcept(is_same< _Tp, __sv_type >::value)β Find last position of a string_view. πsize_type rfind (const basic_string &__str, size_type __pos=npos) const noexceptβ Find last position of a string.size_type rfind (const basic_string &__str, size_type __pos=npos) const noexceptβ twice, of course πvoid shrink_to_fit () noexceptβ no blurb πΈsize_type size () const noexceptβ Returns the number of characters in the string, not including any null-termination. same deal aslength(), no terminator counted βbool starts_with (_CharT __x) const noexceptβ undocumentedbool starts_with (basic_string_view< _CharT, _Traits > __x) const noexceptβ undocumentedbool starts_with (const _CharT *__x) const noexceptβ undocumented, three lil starters with no notes πbasic_string substr (size_type __pos=0, size_type __n=_Base::npos) constβ no description given πvoid swap (basic_string &__s) noexcept(/*conditional */)β Swap contents with another string. trade fits, note thenoexcept(/*conditional */)πvoid swap (basic_string &__x) noexcept(/*conditional */)β no blurb, samenoexcept(/*conditional */)energy π
π Static Public Attributes π
static const size_type nposβ Value returned by various member functions when they fail. the "nope, didn't find it" number π
π‘οΈ Protected Member Functions π‘οΈ
constexpr void _M_swap (_Safe_container &__x) noexceptβ no blurb in the docs, she's internal business π€«
π«Ά Friends π«Ά
template<typename _ItT , typename _SeqT , typename _CatT > class ::__gnu_debug::_Safe_iteratorβ bestie privileges granted, no description given ποΈ
π Detailed Description π
template<typename _CharT, typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>>
class __gnu_debug::basic_string< _CharT, _Traits, _Allocator >
"Class std::basic_string with safety/checking/debug instrumentation."
that's the whole pitch fr fr β it's std::basic_string but with safety/checking/debug instrumentation bolted on, and she's telling you that up front π
β¨
π Member Function Documentation π
okay bestie, this is the big one β every member function, alphabetically, no skips. grab a snack π
π« __resize_and_overwrite
template<typename _CharT , typename _Traits , typename _Alloc >
template<typename _Operation >
void std::basic_string< _CharT, _Traits, _Alloc >::__resize_and_overwrite
(size_type __n, _Operation __op) [inherited]
Non-standard version of resize_and_overwrite for C++11 and above. yes it's got the double underscore, it's a vibe, don't @ me π
π₯ append β the string_view edition
template<typename _CharT , typename _Traits , typename _Alloc >
template<typename _Tp >
_If_sv< _Tp, basic_string & > std::basic_string< _CharT, _Traits, _Alloc >::append
(const _Tp & __svt) [inline], [inherited]
Append a string_view.
- Parameters
__svtβ the object convertible to string_view that's getting appended π«Ά
- Returns β Reference to this string.
References std::basic_string< _CharT, _Traits, _Alloc >::append().
πΈ append β string_view but make it a slice
template<typename _CharT , typename _Traits , typename _Alloc >
template<typename _Tp >
_If_sv< _Tp, basic_string & > std::basic_string< _CharT, _Traits, _Alloc >::append
(const _Tp & __svt, size_type __pos, size_type __n = npos) [inline], [inherited]
Append a range of characters from a string_view. little slice of string_view, iconic β¨
- Parameters
__svtβ the object convertible to string_view to be appended from.__posβ the position in the string_view to append from.__nβ the number of characters to append from the string_view.
- Returns β Reference to this string.
References std::basic_string< _CharT, _Traits, _Alloc >::append().
π append β the classic string-on-string situation
template<typename _CharT , typename _Traits , typename _Alloc >
basic_string< _CharT, _Traits, _Alloc > &
std::basic_string< _CharT, _Traits, _Alloc >::append
(const basic_string< _CharT, _Traits, _Alloc > & __str) [inherited]
Append a string to this string. the original, the blueprint π
- Parameters
__strβ the string to append.
- Returns β Reference to this string.
References std::basic_string< _CharT, _Traits, _Alloc >::size(), and std::size().
Referenced by all of these besties:
std::basic_string< _CharT, _Traits, _Alloc >::append()std::basic_string< _CharT, _Traits, _Alloc >::append()std::basic_string< _CharT, _Traits, _Alloc >::append()std::basic_string< _CharT, _Traits, _Alloc >::append()std::collate< _CharT >::do_transform()std::basic_string< _CharT, _Traits, _Alloc >::operator+=()std::basic_string< _CharT, _Traits, _Alloc >::operator+=()std::basic_string< _CharT, _Traits, _Alloc >::operator+=()std::basic_string< _CharT, _Traits, _Alloc >::operator+=()std::operator>>()
(yes, four append()s and four operator+=()s β that's genuinely what it says, no cap π)
π¦ append β substring core
template<typename _CharT , typename _Traits , typename _Alloc >
basic_string< _CharT, _Traits, _Alloc > &
std::basic_string< _CharT, _Traits, _Alloc >::append
(const basic_string< _CharT, _Traits, _Alloc > & __str,
size_type __pos, size_type __n = npos) [inherited]
Append a substring.
- Parameters
__strβ the string to append.__posβ index of the first character of str to append.__nβ the number of characters to append.
- Returns β Reference to this string.
- Exceptions β
std::out_of_rangeif__posis not a valid index. π¨
This function appends __n characters from __str starting at __pos to this string. If __n is is larger than the number of available characters in __str, the remainder of __str is appended. (the double "is is" is in the source, we respect the source in this house π«‘)
References std::size().
π append β initializer_list era
template<typename _CharT , typename _Traits , typename _Alloc >
basic_string & std::basic_string< _CharT, _Traits, _Alloc >::append
(initializer_list< _CharT > __l) [inline], [inherited]
Append an initializer_list of characters.
- Parameters
__lβ the initializer_list of characters to append.
- Returns β Reference to this string.
References std::basic_string< _CharT, _Traits, _Alloc >::append().
π assign β move it, move it
template<typename _CharT , typename _Traits , typename _Alloc >
basic_string & std::basic_string< _CharT, _Traits, _Alloc >::assign
(basic_string< _CharT, _Traits, _Alloc > && __str) [inline], [noexcept], [inherited]
Set value to contents of another string.
- Parameters
__strβ source string to use.
- Returns β Reference to this string.
This function sets this string to the exact contents of __str. __str is a valid, but unspecified string. β οΈ like, it exists, but don't go assuming things about it, bestie.
References std::basic_string< _CharT, _Traits, _Alloc >::swap().
π§ assign β from a string_view
template<typename _CharT , typename _Traits , typename _Alloc >
template<typename _Tp >
_If_sv< _Tp, basic_string & > std::basic_string< _CharT, _Traits, _Alloc >::assign
(const _Tp & __svt) [inline], [inherited]
Set value from a string_view.
- Parameters
__svtβ the source object convertible to string_view.
- Returns β Reference to this string.
References std::basic_string< _CharT, _Traits, _Alloc >::assign().
π assign β string_view, sliced
template<typename _CharT , typename _Traits , typename _Alloc >
template<typename _Tp >
_If_sv< _Tp, basic_string & > std::basic_string< _CharT, _Traits, _Alloc >::assign
(const _Tp & __svt, size_type __pos, size_type __n = npos) [inline], [inherited]
Set value from a range of characters in a string_view.
- Parameters
__svtβ the source object convertible to string_view.__posβ the position in the string_view to assign from.__nβ the number of characters to assign.
- Returns β Reference to this string.
References std::basic_string< _CharT, _Traits, _Alloc >::assign().
π«Ά assign β copy the whole thing
template<typename _CharT , typename _Traits , typename _Alloc >
basic_string< _CharT, _Traits, _Alloc > &
std::basic_string< _CharT, _Traits, _Alloc >::assign
(const basic_string< _CharT, _Traits, _Alloc > & __str) [inherited]
Set value to contents of another string.
- Parameters
__strβ source string to use.
- Returns β Reference to this string.
References std::basic_string< _CharT, _Traits, _Alloc >::get_allocator().
Referenced by this whole friend group:
std::basic_string< _CharT, _Traits, _Alloc >::assign()std::basic_string< _CharT, _Traits, _Alloc >::assign()std::basic_string< _CharT, _Traits, _Alloc >::assign()std::basic_string< _CharT, _Traits, _Alloc >::assign()std::basic_string< _CharT, _Traits, _Alloc >::assign()std::basic_string< _CharT, _Traits, _Alloc >::operator=()std::basic_string< _CharT, _Traits, _Alloc >::operator=()std::basic_string< _CharT, _Traits, _Alloc >::operator=()std::basic_string< _CharT, _Traits, _Alloc >::operator=()std::basic_string< _CharT, _Traits, _Alloc >::operator=()std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow()std::basic_stringbuf< _CharT, _Traits, _Alloc >::str()std::basic_stringbuf< _CharT, _Traits, _Alloc >::str()
five assign()s and five operator=()s, i counted, they're all really there π
β assign β substring behavior
template<typename _CharT , typename _Traits , typename _Alloc >
basic_string & std::basic_string< _CharT, _Traits, _Alloc >::assign
(const basic_string< _CharT, _Traits, _Alloc > & __str,
size_type __pos, size_type __n = npos) [inline], [inherited]
Set value to a substring of a string.
- Parameters
__strβ the string to use.__posβ index of the first character of str.__nβ number of characters to use.
- Returns β Reference to this string.
- Exceptions β
std::out_of_rangeif pos is not a valid index. π¨
This function sets this string to the substring of __str consisting of __n characters at __pos. If __n is is larger than the number of available characters in __str, the remainder of __str is used.
References std::basic_string< _CharT, _Traits, _Alloc >::assign().
π at β the safe one (read/write)
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>>
reference std::basic_string< _CharT, _Traits, _Alloc >::at (size_type __n) [inline]
Provides access to the data contained in the string.
- Parameters
__nβ the index of the character to access.
- Returns β read/write reference to the character.
- Exceptions β
std::out_of_rangeif n is an invalid index. π¨
This function provides for safer data access. The parameter is first checked that it is in the range of the string. The function throws out_of_range if the check fails. Success results in unsharing the string.
π©΅ at β the safe one (read-only)
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>>
const_reference std::basic_string< _CharT, _Traits, _Alloc >::at
(size_type __n) const [inline]
Provides access to the data contained in the string.
- Parameters
__nβ the index of the character to access.
- Returns β read-only (const) reference to the character.
- Exceptions β
std::out_of_rangeif n is an invalid index. π¨
This function provides for safer data access. The parameter is first checked that it is in the range of the string. The function throws out_of_range if the check fails.
πΈ back β last character, writable
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>>
reference std::basic_string< _CharT, _Traits, _Alloc >::back () [inline]
Returns a read/write reference to the data at the last element of the string. the final girl of the string, she gets a reference π
π§ back β last character, but const
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>>
const_reference std::basic_string< _CharT, _Traits, _Alloc >::back () const
[inline], [noexcept]
Returns a read-only (constant) reference to the data at the last element of the string. no touchy, just looky π
π capacity β how much room she's got
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>>
size_type std::basic_string< _CharT, _Traits, _Alloc >::capacity () const
[inline], [noexcept]
Returns the total number of characters that the string can hold before needing to allocate more memory. it's giving "i have space for you in my life" energy β¨
π compare β versus a C string
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>>
int std::basic_string< _CharT, _Traits, _Alloc >::compare
(const _CharT * __s) const [inline], [noexcept]
Compare to a C string. the OG, the char*, showing up to the party.
- Parameters
__sβ C string to compare against.
- Returns β Integer
< 0,0, or> 0.
Returns an integer < 0 if this string is ordered before __s, 0 if their values are equivalent, or > 0 if this string is ordered after __s. Determines the effective length rlen of the strings to compare as the smallest of size() and the length of a string constructed from __s. The function then compares the two strings by calling traits::compare(data(),s,rlen). If the result of the comparison is nonzero returns it, otherwise the shorter one is ordered first. short king gets the win, that's just the rules π
π¦ compare β versus a string_view
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>>
template<typename _Tp >
_If_sv< _Tp, int > std::basic_string< _CharT, _Traits, _Alloc >::compare
(const _Tp & __svt) const [inline], [noexcept]
Compare to a string_view.
- Parameters
__svtβ an object convertible to string_view to compare against.
- Returns β Integer
< 0,0, or> 0. - Return value β oh and it returns an integer:
< 0,0, or> 0. β¨
Okay bestie, real talk: it returns an integer< 0if this string is ordered before__str,0if their values are equivalent, or> 0if this string is ordered after__str. It figures out the effective lengthrlenof the strings to compare as the smallest ofsize()andstr.size(). Then it compares the two strings by callingtraits::compare(data(), str.data(),rlen). If the result of the comparison is nonzero it returns it, otherwise the shorter one is ordered first. π
References: std::basic_string< _CharT, _Traits, _Alloc >::data(), std::min(), and std::basic_string< _CharT, _Traits, _Alloc >::size().
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> int std::basic_string<
_CharT, _Traits, _Alloc >::compare (const basic_string< _CharT, _Traits,
_Allocator > & __str) const [inline]
π¦ Compare to a string (the version with the pretty defaults)
Literally the same energy as the one above, just with the default template args spelled out all cute. πΈ
__strβ the string you're comparing against, bestie.
Returns: an integer < 0, 0, or > 0.
Same deal fr fr: returns an integer< 0if this string is ordered before__str,0if their values are equivalent, or> 0if this string is ordered after__str. It determines the effective lengthrlenof the strings to compare as the smallest ofsize()andstr.size(). Then it compares the two strings by callingtraits::compare(data(), str.data(),rlen). If the result of the comparison is nonzero it returns it; otherwise the shorter one is ordered first. No cap. π«Ά
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> template<typename _Tp >
_If_sv< _Tp, int > std::basic_string< _CharT, _Traits, _Alloc >::compare
(size_type __pos, size_type __n, const _Tp & __svt) const [inline],
[noexcept]
β Compare to a string_view
Okay so this one's fab because it's [noexcept] β it's giving trustworthy main character energy. π
__posβ a position in the string to start comparing from.__nβ the number of characters to compare.__svtβ an object convertible tostring_viewto compare against.
Returns: an integer < 0, 0, or > 0. π
template<typename _CharT , typename _Traits , typename _Alloc > int
std::basic_string< _CharT, _Traits, _Alloc >::compare (size_type __pos,
size_type __n, const basic_string< _CharT, _Traits, _Alloc > & __str)
const [inline], [inherited]
π Compare substring to a string
Substring era!! We're not comparing the whole thing anymore, just a lil slice. π
__posβ index of first character of substring.__nβ number of characters in substring.__strβ string to compare against.
Returns: an integer < 0, 0, or > 0.
So what happens: form the substring of this string from the__ncharacters starting at__pos. Returns an integer< 0if the substring is ordered before__str,0if their values are equivalent, or> 0if the substring is ordered after__str. It determines the effective lengthrlenof the strings to compare as the smallest of the length of the substring and__str.size(). Then it compares the two strings by callingtraits::compare(substring.data(),str.data(),rlen). If the result of the comparison is nonzero it returns it, otherwise the shorter one is ordered first. π (in a slay way)
References: std::basic_string< _CharT, _Traits, _Alloc >::data(), std::min(), and std::basic_string< _CharT, _Traits, _Alloc >::size().
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> int std::basic_string<
_CharT, _Traits, _Alloc >::compare (size_type __pos, size_type __n,
const basic_string< _CharT, _Traits, _Allocator > & __str) const
[inline]
π Compare substring to a string (again, but make it default-args)
Same function, same facts, just the _Traits / _Allocator defaults showing off. Obsessed. β¨
__posβ index of first character of substring.__nβ number of characters in substring.__strβ string to compare against.
Returns: an integer < 0, 0, or > 0.
Form the substring of this string from the__ncharacters starting at__pos. Returns an integer< 0if the substring is ordered before__str,0if their values are equivalent, or> 0if the substring is ordered after__str. It determines the effective lengthrlenof the strings to compare as the smallest of the length of the substring and__str.size(). Then it compares the two strings by callingtraits::compare(substring.data(),str.data(),rlen). If the result of the comparison is nonzero it returns it, otherwise the shorter one is ordered first. π
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> int std::basic_string<
_CharT, _Traits, _Alloc >::compare (size_type __pos, size_type __n1,
const _CharT * __s) const [inline]
π§ Compare substring to a C string
A C string walked in, bestie. No std::basic_string wrapper, just vibes and a pointer. π
__posβ index of first character of substring.__n1β number of characters in substring.__sβ C string to compare against.
Returns: an integer < 0, 0, or > 0.
Form the substring of this string from the__n1characters starting atpos. Returns an integer< 0if the substring is ordered before__s,0if their values are equivalent, or> 0if the substring is ordered after__s. It determines the effective lengthrlenof the strings to compare as the smallest of the length of the substring and the length of a string constructed from__s. Then it compares the two string by callingtraits::compare(substring.data(),__s,rlen). If the result of the comparison is nonzero it returns it, otherwise the shorter one is ordered first. πΈ
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> int std::basic_string<
_CharT, _Traits, _Alloc >::compare (size_type __pos, size_type __n1,
const _CharT * __s, size_type __n2) const [inline]
π₯ Compare substring against a character array
Now there's a __n2 in the mix and it's giving precise. Iconic behaviour. π
__posβ index of first character of substring.__n1β number of characters in substring.__sβ character array to compare against.__n2β number of characters ofs.
Returns: an integer < 0, 0, or > 0.
Form the substring of this string from the__n1characters starting at__pos. Form a string from the first__n2characters of__s. Returns an integer< 0if this substring is ordered before the string from__s,0if their values are equivalent, or> 0if this substring is ordered after the string from__s. It determines the effective lengthrlenof the strings to compare as the smallest of the length of the substring and__n2. Then it compares the two strings by callingtraits::compare(substring.data(),s,rlen). If the result of the comparison is nonzero it returns it, otherwise the shorter one is ordered first. π¦
NB:smust have at leastn2characters,'\0'has no special meaning. π¨ Like, for real for real, do not come in here with a short buffer and expect the null terminator to save you. It will not. It is not that girl. π
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> template<typename _Tp >
_If_sv< _Tp, int > std::basic_string< _CharT, _Traits, _Alloc >::compare
(size_type __pos1, size_type __n1, const _Tp & __svt, size_type __pos2,
size_type __n2 = npos) const [inline], [noexcept]
π Compare to a string_view (the deluxe two-position edition)
Two positions, two lengths, one very [noexcept] queen. β
__pos1β a position in the string to start comparing from.__n1β the number of characters to compare.__svtβ an object convertible tostring_viewto compare against.__pos2β a position in thestring_viewto start comparing from.__n2β the number of characters to compare. It has a default:npos. π
Returns: an integer < 0, 0, or > 0.
template<typename _CharT , typename _Traits , typename _Alloc > int
std::basic_string< _CharT, _Traits, _Alloc >::compare (size_type __pos1,
size_type __n1, const basic_string< _CharT, _Traits, _Alloc > & __str,
size_type __pos2, size_type __n2 = npos) const [inline], [inherited]
π Compare substring to a substring
Substring vs substring. A whole collision of slices. This is the main event, bestie. π₯
__pos1β index of first character of substring.__n1β number of characters in substring.__strβ string to compare against.__pos2β index of first character of substring ofstr.__n2β number of characters in substring ofstr. Defaults tonpos. π
Returns: an integer < 0, 0, or > 0.
Form the substring of this string from the__n1characters starting at__pos1. Form the substring of__strfrom the__n2characters starting at__pos2. Returns an integer< 0if this substring is ordered before the substring of__str,0if their values are equivalent, or> 0if this substring is ordered after the substring of__str. It determines the effective lengthrlenof the strings to compare as the smallest of the lengths of the substrings. Then it compares the two strings by callingtraits::compare(substring.data(),str.substr(pos2,n2).data(),rlen). If the result of the comparison is nonzero it returns it, otherwise the shorter one is ordered first. β¨
References: std::basic_string< _CharT, _Traits, _Alloc >::data(), and std::min().
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> int std::basic_string<
_CharT, _Traits, _Alloc >::compare (size_type __pos1, size_type __n1,
const basic_string< _CharT, _Traits, _Allocator > & __str, size_type
__pos2, size_type __n2 = npos) const [inline]
π Compare substring to a substring (default-args remix)
Yeah okay this is the same thing again with the defaults written out. Slay, consistent queen. π
__pos1β index of first character of substring.__n1β number of characters in substring.__strβ string to compare against.__pos2β index of first character of substring ofstr.__n2β number of characters in substring ofstr. Defaults tonpos.
Returns: an integer < 0, 0, or > 0.
Form the substring of this string from the__n1characters starting at__pos1. Form the substring of__strfrom the__n2characters starting at__pos2. Returns an integer< 0if this substring is ordered before the substring of__str,0if their values are equivalent, or> 0if this substring is ordered after the substring of__str. It determines the effective lengthrlenof the strings to compare as the smallest of the lengths of the substrings. Then it compares the two strings by callingtraits::compare(substring.data(),str.substr(pos2,n2).data(),rlen). If the result of the comparison is nonzero it returns it, otherwise the shorter one is ordered first. π§
template<typename _CharT , typename _Traits , typename _Alloc > _CharT *
std::basic_string< _CharT, _Traits, _Alloc >::data () [inline],
[noexcept], [inherited]
π«Ά data() β return non-const pointer to contents
This is a pointer to the character sequence held by the string. And here's the plot twist: modifying the characters in the sequence is allowed. π³π₯ It's [noexcept] too, so she's chill about it.
Lowkey read that again β modifying the characters is allowed here. That's the whole point of this overload. You get a_CharT *, not aconst _CharT *, so go off. But bestie, that also means if you write past the end it's on you β this page isn't handing out safety nets. π
π empty() β the instant βam I giving nothing?β check
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> bool std::basic_string<
_CharT, _Traits, _Alloc >::empty () const [inline], [noexcept]
Returns true if the string is empty. Equivalent to *this == ''. Thatβs it, bestie β the tiniest vibe check in the whole string class. π
βοΈ erase(iterator, iterator) β delete a whole little range
template<typename _CharT , typename _Traits , typename _Alloc >
basic_string< _CharT, _Traits, _Alloc >::iterator std::basic_string<
_CharT, _Traits, _Alloc >::erase (iterator __first, iterator __last)
[inherited]
Remove a range of characters. Very βclear the group chat from message 12 to 47β energy.
- Parameters
__firstβ iterator referencing the first character to remove.__lastβ iterator referencing the end of the range.
- Returns β an iterator referencing the location of the first after removal.
Removes the characters in the range [first,last) from this string. The value of the string doesnβt change if an error is thrown. No cap, that safety bit matters. π«Ά
πͺ erase(iterator) β one character, gone
template<typename _CharT , typename _Traits , typename _Alloc > iterator
std::basic_string< _CharT, _Traits, _Alloc >::erase (iterator
__position) [inline], [inherited]
Remove one character. Single-target elimination, main character style.
- Parameters
__positionβ iterator referencing the character to remove.
- Returns β iterator referencing the same location after removal.
Removes the character at __position from this string. The value of the string doesnβt change if an error is thrown. Periodt. π
π find(_CharT, size_type) β whereβs my character at?
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> basic_string< _CharT,
_Traits, _Alloc >::size_type std::basic_string< _CharT, _Traits, _Alloc
>::find (_CharT __c, size_type __pos = 0) const [noexcept]
Find position of a character. The classic βhave you seen her?β search.
- Parameters
__cβ character to locate.__posβ index of character to search from (default0).
- Returns β index of first occurrence.
Starting from __pos, searches forward for __c within this string. If found, returns the index where it was found. If not found, returns npos. Soft launch: npos means sheβs not here. π
π§΅ find(const _CharT*, size_type, size_type) β C substring hunt
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> basic_string< _CharT,
_Traits, _Alloc >::size_type std::basic_string< _CharT, _Traits, _Alloc
>::find (const _CharT * __s, size_type __pos, size_type __n) const
[noexcept]
Find position of a C substring. Youβre not searching the whole C string, just the first __n characters of it. Selective.
- Parameters
__sβ C string to locate.__posβ index of character to search from.__nβ number of characters fromsto search for.
- Returns β index of start of first occurrence.
Starting from __pos, searches forward for the first __n characters in __s within this string. If found, returns the index where it begins. If not found, returns npos. β¨
π find(const _CharT*, size_type) β C string hunt
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::find (const _CharT * __s,
size_type __pos = 0) const [inline], [noexcept]
Find position of a C string. Full C-string search, no __n little shortcut.
- Parameters
__sβ C string to locate.__posβ index of character to search from (default0).
- Returns β index of start of first occurrence.
Starting from __pos, searches forward for the value of __s within this string. If found, returns the index where it begins. If not found, returns npos. Slay. π¦
πΈ find(const _Tp&, size_type) β string_view find
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> template<typename _Tp >
_If_sv< _Tp, size_type > std::basic_string< _CharT, _Traits, _Alloc
>::find (const _Tp & __svt, size_type __pos = 0) const [inline],
[noexcept]
Find position of a string_view. This one is for the object thatβs convertible to string_view. Fancy but lowkey.
- Parameters
__svtβ the object convertible tostring_viewto locate.__posβ index of character to search from (default0).
- Returns β index of start of first occurrence.
Thatβs the whole note here β no extra lore in this entry. π
π find(const basic_string&, size_type) β inherited string find
template<typename _CharT , typename _Traits , typename _Alloc > size_type
std::basic_string< _CharT, _Traits, _Alloc >::find (const basic_string<
_CharT, _Traits, _Alloc > & __str, size_type __pos = 0) const [inline],
[noexcept], [inherited]
Find position of a string. The [inherited] tag is right there, bestie.
- Parameters
__strβ string to locate.__posβ index of character to search from (default0).
- Returns β index of start of first occurrence.
Starting from __pos, searches forward for value of __str within this string. If found, returns the index where it begins. If not found, returns npos.
- References β
std::basic_string< _CharT, _Traits, _Alloc >::data(),std::basic_string< _CharT, _Traits, _Alloc >::find(), andstd::basic_string< _CharT, _Traits, _Alloc >::size().
π find(const basic_string&, size_type) β the allocator-name twin
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::find (const basic_string<
_CharT, _Traits, _Allocator > & __str, size_type __pos = 0) const
[inline], [noexcept]
Find position of a string. Same βwhere is she?β mission, but the parameter is spelled with _Allocator in the signature. Character-for-character twin behavior, no invented extras.
- Parameters
__strβ string to locate.__posβ index of character to search from (default0).
- Returns β index of start of first occurrence.
Starting from __pos, searches forward for value of __str within this string. If found, returns the index where it begins. If not found, returns npos. π
π find_first_not_of(_CharT, size_type) β find literally anything else
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> basic_string< _CharT,
_Traits, _Alloc >::size_type std::basic_string< _CharT, _Traits, _Alloc
>::find_first_not_of (_CharT __c, size_type __pos = 0) const [noexcept]
Find position of a different character. The anti-__c search. Avoid this character at all costs.
- Parameters
__cβ character to avoid.__posβ index of character to search from (default0).
- Returns β index of first occurrence.
Starting from __pos, searches forward for a character other than __c within this string. If found, returns the index where it was found. If not found, returns npos. Itβs giving βnot like other girlsβ but in index form. π
π find_first_not_of(const _CharT*, size_type, size_type) β avoid these C substring chars
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> basic_string< _CharT,
_Traits, _Alloc >::size_type std::basic_string< _CharT, _Traits, _Alloc
>::find_first_not_of (const _CharT * __s, size_type __pos, size_type
__n) const [noexcept]
Find position of a character not in C substring. Youβre avoiding only the first __n characters of __s, not the whole thing. Very specific.
- Parameters
__sβ C string containing characters to avoid.__posβ index of character to search from.__nβ number of characters from__sto consider.
- Returns β index of first occurrence.
Starting from __pos, searches forward for a character not contained in the first __n characters of __s within this string. If found, returns the index where it was found. If not found, returns npos. π
π§ find_first_not_of(const _CharT*, size_type) β avoid this C string
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::find_first_not_of (const
_CharT * __s, size_type __pos = 0) const [inline], [noexcept]
Find position of a character not in C string. Full __s avoid list, no __n limits.
- Parameters
__sβ C string containing characters to avoid.__posβ index of character to search from (default0).
- Returns β index of first occurrence.
Starting from __pos, searches forward for a character not contained in __s within this string. If found, returns the index where it was found. If not found, returns npos. πΈ
π¦ find_first_not_of(const _Tp&, size_type) β avoid these string_view chars
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> template<typename _Tp >
_If_sv< _Tp, size_type > std::basic_string< _CharT, _Traits, _Alloc
>::find_first_not_of (const _Tp & __svt, size_type __pos = 0) const
[inline], [noexcept]
Find position of a character not in a string_view. Same avoid-list energy, but the object is convertible to string_view.
- Parameters
__svtβ an object convertible tostring_viewcontaining characters to avoid.__posβ index of character to search from (default0).
- Returns β index of first occurrence.
No extra prose in this entry β just the parameters and the return. Keep it moving, bestie. π
π find_first_not_of(const basic_string&, size_type) β inherited avoid-string
template<typename _CharT , typename _Traits , typename _Alloc > size_type
std::basic_string< _CharT, _Traits, _Alloc >::find_first_not_of (const
basic_string< _CharT, _Traits, _Alloc > & __str, size_type __pos = 0)
const [inline], [noexcept], [inherited]
Find position of a character not in string. Avoid the characters that live in __str. So real.
- Parameters
__strβ string containing characters to avoid.__posβ index of character to search from (default0).
- Returns β index of first occurrence.
Starting from __pos, searches forward for a character not contained in __str within this string. If found, returns the index where it was found. If not found, returns npos.
- References β
std::basic_string< _CharT, _Traits, _Alloc >::data(),std::basic_string< _CharT, _Traits, _Alloc >::find_first_not_of(), andstd::basic_string< _CharT, _Traits, _Alloc >::size(). - Referenced by β
std::basic_string< _CharT, _Traits, _Alloc >::find_first_not_of(),std::basic_string< _CharT, _Traits, _Alloc >::find_first_not_of(), andstd::basic_string< _CharT, _Traits, _Alloc >::find_first_not_of().
Thatβs three identical find_first_not_of() references in the original, and weβre keeping all three. No erasing the receipts. π«Ά
π find_first_not_of(const basic_string&, size_type) β allocator-name twin
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::find_first_not_of (const
basic_string< _CharT, _Traits, _Allocator > & __str, size_type __pos =
0) const [inline], [noexcept]
Find position of a character not in string. Same mission, with _Allocator showing up in the parameter type.
- Parameters
__strβ string containing characters to avoid.__posβ index of character to search from (default0).
- Returns β index of first occurrence.
Starting from __pos, searches forward for a character not contained in __str within this string. If found, returns the index where it was found. If not found, returns npos. π
π₯ find_first_of(_CharT, size_type) β first matching character
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::find_first_of (_CharT __c,
size_type __pos = 0) const [inline], [noexcept]
Find position of a character. Itβs literally the βdo I have this one?β check.
- Parameters
__cβ character to locate.__posβ index of character to search from (default0).
- Returns β index of first occurrence.
Starting from __pos, searches forward for the character __c within this string. If found, returns the index where it was found. If not found, returns npos.
Note: equivalent to find(__c, __pos).
Iconic shortcut behavior, no notes missed. π
β find_first_of(const _CharT*, size_type, size_type) β matching chars from a C substring
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> basic_string< _CharT,
_Traits, _Alloc >::size_type std::basic_string< _CharT, _Traits, _Alloc
>::find_first_of (const _CharT * __s, size_type __pos, size_type __n)
const [noexcept]
Find position of a character of C substring. Youβre looking for any character from the first __n characters of __s.
- Parameters
__sβ string containing characters to locate.__posβ index of character to search from.__nβ number of characters fromsto search for.
- Returns β index of first occurrence.
okay so picking right back up where we left off β __pos is your starting point, and you're scrolling forward through the string looking for any one of the first __n characters of __s just vibing in there. Found one? slay, you get the index of where it was. Not found? npos, bestie. Always npos. π
β¨ find_first_of (C string version) β¨
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::find_first_of (const
_CharT * __s, size_type __pos = 0) const [inline], [noexcept]
Find position of a character of C string. fr fr that's the whole gig π
Parameters
__sβ String containing characters to locate.__posβ Index of character to search from (default0).
Returns
Index of first occurrence.
Starting from __pos, searches forward for one of the characters of __s within this string. Found it? You get the index where it was found. Didn't find it? npos. That's it, that's the whole story π¦
β¨ find_first_of (string_view version) β¨
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> template<typename _Tp >
_If_sv< _Tp, size_type > std::basic_string< _CharT, _Traits, _Alloc
>::find_first_of (const _Tp & __svt, size_type __pos = 0) const
[inline], [noexcept]
Find position of a character of a string_view. the string_view girly pop version π
Parameters
__svtβ An object convertible tostring_viewcontaining characters to locate.__posβ Index of character to search from (default0).
Returns
Index of first occurrence.
β¨ find_first_of (basic_string version, the [inherited] one) β¨
template<typename _CharT , typename _Traits , typename _Alloc > size_type
std::basic_string< _CharT, _Traits, _Alloc >::find_first_of (const
basic_string< _CharT, _Traits, _Alloc > & __str, size_type __pos = 0)
const [inline], [noexcept], [inherited]
Find position of a character of string. yes queen, another one π
Parameters
__strβ String containing characters to locate.__posβ Index of character to search from (default0).
Returns
Index of first occurrence.
Starting from __pos, searches forward for one of the characters of __str within this string. If found, returns the index where it was found. If not found, returns npos. same energy, different parameter π
References std::basic_string< _CharT, _Traits, _Alloc >::data(), std::basic_string< _CharT, _Traits, _Alloc >::find_first_of(), and std::basic_string< _CharT, _Traits, _Alloc >::size().
Referenced by std::basic_string< _CharT, _Traits, _Alloc >::find_first_of(), std::basic_string< _CharT, _Traits, _Alloc >::find_first_of(), and std::basic_string< _CharT, _Traits, _Alloc >::find_first_of(). (yes it's listing itself three times, no I will not be explaining, it's giving recursion energy π)
β¨ find_first_of (basic_string version, _Allocator flavored) β¨
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::find_first_of (const
basic_string< _CharT, _Traits, _Allocator > & __str, size_type __pos =
0) const [inline], [noexcept]
Find position of a character of string. notice the template param says _Allocator in the argument and _Alloc in the class β that is NOT a typo, do not come for me πΈ
Parameters
__strβ String containing characters to locate.__posβ Index of character to search from (default0).
Returns
Index of first occurrence.
Starting from __pos, searches forward for one of the characters of __str within this string. If found, returns the index where it was found. If not found, returns npos. π«Ά
β¨ find_last_not_of (single character version) β¨
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> basic_string< _CharT,
_Traits, _Alloc >::size_type std::basic_string< _CharT, _Traits, _Alloc
>::find_last_not_of (_CharT __c, size_type __pos = npos) const
[noexcept]
Find last position of a different character. the "not like the other girls" of string search π
Parameters
__cβ Character to avoid.__posβ Index of character to search back from (default end).
Returns
Index of last occurrence.
Starting from __pos, searches backward for a character other than __c within this string. Found one that isn't __c? You get its index. Found nothing? npos. she's picky, she's selective, she's iconic β¨
β¨ find_last_not_of (C substring version) β¨
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> basic_string< _CharT,
_Traits, _Alloc >::size_type std::basic_string< _CharT, _Traits, _Alloc
>::find_last_not_of (const _CharT * __s, size_type __pos, size_type __n)
const [noexcept]
Find last position of a character not in C substring.
Parameters
__sβ C string containing characters to avoid.__posβ Index of character to search back from.__nβ Number of characters fromsto consider.
Returns
Index of last occurrence.
Starting from __pos, searches backward for a character not contained in the first __n characters of __s within this string. If found, returns the index where it was found. If not found, returns npos. π¦
β¨ find_last_not_of (C string version) β¨
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::find_last_not_of (const
_CharT * __s, size_type __pos = npos) const [inline], [noexcept]
Find last position of a character not in C string.
Parameters
__sβ C string containing characters to avoid.__posβ Index of character to search back from (default end).
Returns
Index of last occurrence.
Starting from __pos, searches backward for a character not contained in __s within this string. Found it? index. Not found? npos. no cap π―
β¨ find_last_not_of (string_view version) β¨
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> template<typename _Tp >
_If_sv< _Tp, size_type > std::basic_string< _CharT, _Traits, _Alloc
>::find_last_not_of (const _Tp & __svt, size_type __pos = npos) const
[inline], [noexcept]
Find last position of a character not in a string_view. π
Parameters
__svtβ An object convertible tostring_viewcontaining characters to avoid.__posβ Index of character to search back from (default end).
Returns
Index of last occurrence.
β¨ find_last_not_of (basic_string version, the [inherited] one) β¨
template<typename _CharT , typename _Traits , typename _Alloc > size_type
std::basic_string< _CharT, _Traits, _Alloc >::find_last_not_of (const
basic_string< _CharT, _Traits, _Alloc > & __str, size_type __pos = npos)
const [inline], [noexcept], [inherited]
Find last position of a character not in string. π
Parameters
__strβ String containing characters to avoid.__posβ Index of character to search back from (default end).
Returns
Index of last occurrence.
Starting from __pos, searches backward for a character not contained in __str within this string. If found, returns the index where it was found. If not found, returns npos. π
References std::basic_string< _CharT, _Traits, _Alloc >::data(), std::basic_string< _CharT, _Traits, _Alloc >::find_last_not_of(), and std::basic_string< _CharT, _Traits, _Alloc >::size().
Referenced by std::basic_string< _CharT, _Traits, _Alloc >::find_last_not_of(), std::basic_string< _CharT, _Traits, _Alloc >::find_last_not_of(), and std::basic_string< _CharT, _Traits, _Alloc >::find_last_not_of(). (three times. again. it's a whole thing. π)
β¨ find_last_not_of (basic_string version, _Allocator flavored) β¨
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::find_last_not_of (const
basic_string< _CharT, _Traits, _Allocator > & __str, size_type __pos =
npos) const [inline], [noexcept]
Find last position of a character not in string. πΈ
Parameters
__strβ String containing characters to avoid.__posβ Index of character to search back from (default end).
Returns
Index of last occurrence.
Starting from __pos, searches backward for a character not contained in __str within this string. If found, returns the index where it was found. If not found, returns npos. π«Ά
β¨ find_last_of (single character version) β¨
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::find_last_of (_CharT __c,
size_type __pos = npos) const [inline], [noexcept]
Find last position of a character. the "yes actually I am looking for you" counterpart to the last one π
Parameters
__cβ Character to locate.__posβ Index of character to search back from (default end).
Returns
Index of last occurrence.
Starting from __pos, searches backward for __c within this string. If found, returns the index where it was found. If not found, returns npos. β¨
Note: equivalent to rfind(__c, __pos).
β¨ find_last_of (C substring version) β¨
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> basic_string< _CharT,
_Traits, _Alloc >::size_type std::basic_string< _CharT, _Traits, _Alloc
>::find_last_of (const _CharT * __s, size_type __pos, size_type __n)
const [noexcept]
Find last position of a character of C substring. π₯
Parameters
__sβ C string containing characters to locate.__posβ Index of character to search back from.__nβ Number of characters fromsto search for.
Returns
Index of last occurrence.
Starting from __pos, searches backward for one of the first __n characters of __s within this string. If found, returns the index where it was found. If not found, returns npos. π¦
β¨ find_last_of (C string version) β¨
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::find_last_of (const _CharT
* __s, size_type __pos = npos) const [inline], [noexcept]
Find last position of a character of C string. π
Parameters
__sβ C string containing characters to locate.__posβ Index of character to search back from (default end).
Returns
Index of last occurrence.
Starting from __pos, searches backward for one of the characters of __s within this string. If found, returns the index where it was found. If not found, returns npos. literally the same deal as always, just backwards π
β¨ find_last_of (string_view version) β¨
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> template<typename _Tp >
_If_sv< _Tp, size_type > std::basic_string< _CharT, _Traits, _Alloc
>::find_last_of (const _Tp & __svt, size_type __pos = npos) const
[inline], [noexcept]
Find last position of a character of string. π
Parameters
__svtβ An object convertible tostring_viewcontaining characters to locate.__posβ Index of character to search back from (default end).
Returns
Index of last occurrence.
β¨ find_last_of (basic_string version, the [inherited] one) β¨
template<typename _CharT , typename _Traits , typename _Alloc > size_type
std::basic_string< _CharT, _Traits, _Alloc >::find_last_of (const
basic_string< _CharT, _Traits, _Alloc > & __str, size_type __pos = npos)
const [inline], [noexcept], [inherited]
Find last position of a character of string. π
Parameters
__strβ String containing characters to locate.__posβ Index of character to search back from (default end).
Returns
Index of last occurrence.
Starting from __pos, it goes backward looking for any one of the characters in __str that also lives in this string. Found it? You get the index where it's chillin'. Not found? npos. That's it, that's the vibe. π
References std::basic_string< _CharT, _Traits, _Alloc >::data(), std::basic_string< _CharT, _Traits, _Alloc >::find_last_of(), and std::basic_string< _CharT, _Traits, _Alloc >::size().
Referenced by std::basic_string< _CharT, _Traits, _Alloc >::find_last_of(), std::basic_string< _CharT, _Traits, _Alloc >::find_last_of(), and std::basic_string< _CharT, _Traits, _Alloc >::find_last_of().
πΈ find_last_of (the string version, bestie)
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::find_last_of (const
basic_string< _CharT, _Traits, _Allocator > & __str, size_type __pos =
npos) const [inline], [noexcept]
Find last position of a character of string. Like, the last one, periodt.
Parameters
__strβ String containing characters to locate. π__posβ Index of character to search back from (default end).
Returns
Index of last occurrence. π―
Starting from __pos, searches backward for one of the characters of __str within this string. If found, returns the index where it was found. If not found, returns npos. No cap.
π¦ front (the glow-up version, read/write)
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> reference
std::basic_string< _CharT, _Traits, _Alloc >::front () [inline]
Returns a read/write reference to the data at the first element of the string. You can literally touch it. Main character energy at index zero. β¨
π front (const version, look don't touch)
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> const_reference
std::basic_string< _CharT, _Traits, _Alloc >::front () const [inline],
[noexcept]
Returns a read-only (constant) reference to the data at the first element of the string. Admire from a distance, bestie. π
π get_allocator
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> allocator_type
std::basic_string< _CharT, _Traits, _Alloc >::get_allocator () const
[inline], [noexcept]
Return copy of allocator used to construct this string. It's giving "here's the receipts of who built me." π§Ύ
π₯ insert β single character
template<typename _CharT , typename _Traits , typename _Alloc > iterator
std::basic_string< _CharT, _Traits, _Alloc >::insert (iterator __p,
_CharT __c) [inline], [inherited]
Insert one character. Just the one. A little guy. π
Parameters
__pβ Iterator referencing position in string to insert at.__cβ The character to insert.
Returns
Iterator referencing newly inserted char.
Exceptions
std::length_errorβ If new length exceedsmax_size().
Inserts character __c at position referenced by __p. If adding character causes the length to exceed max_size(), length_error is thrown. If __p is beyond end of string, out_of_range is thrown. The value of the string doesn't change if an error is thrown. Iconic safety behaviour honestly. π
π insert β a whole range, we love a range
template<typename _CharT , typename _Traits , typename _Alloc >
template<class _InputIterator > void std::basic_string< _CharT, _Traits,
_Alloc >::insert (iterator __p, _InputIterator __beg, _InputIterator
__end) [inline], [inherited]
Insert a range of characters. Bring the whole friend group. π
Parameters
__pβ Iterator referencing location in string to insert at.__begβ Start of range.__endβ End of range.
Exceptions
std::length_errorβ If new length exceedsmax_size().
Inserts characters in range [__beg,__end). If adding characters causes the length to exceed max_size(), length_error is thrown. The value of the string doesn't change if an error is thrown.
References std::basic_string< _CharT, _Traits, _Alloc >::replace().
π§ insert β initializer_list edition
template<typename _CharT , typename _Traits , typename _Alloc > void
std::basic_string< _CharT, _Traits, _Alloc >::insert (iterator __p,
initializer_list< _CharT > __l) [inline], [inherited]
Insert an initializer_list of characters.
Parameters
__pβ Iterator referencing location in string to insert at.__lβ Theinitializer_listof characters to insert.
Exceptions
std::length_errorβ If new length exceedsmax_size().
References std::basic_string< _CharT, _Traits, _Alloc >::insert().
β insert β __n copies of one char
template<typename _CharT , typename _Traits , typename _Alloc > void
std::basic_string< _CharT, _Traits, _Alloc >::insert (iterator __p,
size_type __n, _CharT __c) [inline], [inherited]
Insert multiple characters. Copy-paste energy but, like, on purpose. π«Ά
Parameters
__pβ Iterator referencing location in string to insert at.__nβ Number of characters to insert__cβ The character to insert.
Exceptions
std::length_errorβ If new length exceedsmax_size().
Inserts __n copies of character __c starting at the position referenced by iterator __p. If adding characters causes the length to exceed max_size(), length_error is thrown. The value of the string doesn't change if an error is thrown.
References std::basic_string< _CharT, _Traits, _Alloc >::replace().
Referenced by std::basic_string< _CharT, _Traits, _Alloc >::insert(), std::basic_string< _CharT, _Traits, _Alloc >::insert(), std::basic_string< _CharT, _Traits, _Alloc >::insert(), std::basic_string< _CharT, _Traits, _Alloc >::insert(), and std::basic_string< _CharT, _Traits, _Alloc >::insert(). (Yes, five of them. It's a whole family reunion. π)
π insert β string_view, the pos version
template<typename _CharT , typename _Traits , typename _Alloc >
template<typename _Tp > _If_sv< _Tp, basic_string & > std::basic_string<
_CharT, _Traits, _Alloc >::insert (size_type __pos, const _Tp & __svt)
[inline], [inherited]
Insert a string_view. Views are lowkey superior, ngl.
Parameters
__posβ Position in string to insert at.__svtβ The object convertible tostring_viewto insert.
Returns
Reference to this string.
References std::basic_string< _CharT, _Traits, _Alloc >::insert().
πΈ insert β string_view, the pos + pos + n version
template<typename _CharT , typename _Traits , typename _Alloc >
template<typename _Tp > _If_sv< _Tp, basic_string & > std::basic_string<
_CharT, _Traits, _Alloc >::insert (size_type __pos1, const _Tp & __svt,
size_type __pos2, size_type __n = npos) [inline], [inherited]
Insert a string_view. But like, a slice of one. Fancy.
Parameters
__pos1β Position in string to insert at.__svtβ The object convertible tostring_viewto insert from.__pos2β Position instring_viewto insert from.__nβ The number of characters to insert.
Returns
Reference to this string.
References std::basic_string< _CharT, _Traits, _Alloc >::replace().
π
insert β whole string, no thoughts
template<typename _CharT , typename _Traits , typename _Alloc > basic_string
& std::basic_string< _CharT, _Traits, _Alloc >::insert (size_type
__pos1, const basic_string< _CharT, _Traits, _Alloc > & __str) [inline],
[inherited]
Insert value of a string.
Parameters
__pos1β Position in string to insert at.__strβ The string to insert.
Returns
Reference to this string.
Exceptions
std::length_errorβ If new length exceedsmax_size().
Inserts value of __str starting at __pos1. If adding characters causes the length to exceed max_size(), length_error is thrown. The value of the string doesn't change if an error is thrown.
References std::basic_string< _CharT, _Traits, _Alloc >::insert(), and std::basic_string< _CharT, _Traits, _Alloc >::size().
π¦ insert β substring, we're being selective
template<typename _CharT , typename _Traits , typename _Alloc > basic_string
& std::basic_string< _CharT, _Traits, _Alloc >::insert (size_type
__pos1, const basic_string< _CharT, _Traits, _Alloc > & __str, size_type
__pos2, size_type __n = npos) [inline], [inherited]
Insert a substring. Only part of the group chat gets invited.
Parameters
__pos1β Position in string to insert at.__strβ The string to insert.__pos2β Start of characters instrto insert.__nβ Number of characters to insert.
Returns
Reference to this string.
Exceptions
std::length_errorβ If new length exceedsmax_size().std::out_of_rangeβ Ifpos1 > size()or__pos2 > str.size().
Starting at pos1, insert __n character of __str beginning with __pos2. If adding characters causes the length to exceed max_size(), length_error is thrown. If __pos1 is beyond the end of this string or __pos2 is beyond the end of __str, out_of_range is thrown. The value of the string doesn't change if an error is thrown. Bestie, it's safe β mess it up and your string is untouched. π
References std::basic_string< _CharT, _Traits, _Alloc >::insert().
π length
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::length () const [inline],
[noexcept]
Returns the number of characters in the string, not including any null-termination. So the little \0 gremlin at the end doesn't count, okay? π
ββοΈ
π max_size
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::max_size () const [inline],
[noexcept]
Returns the size() of the largest possible string. The absolute limit. The final boss. π
π operator __sv_type β the string_view conversion
template<typename _CharT , typename _Traits , typename _Alloc >
std::basic_string< _CharT, _Traits, _Alloc >::operator __sv_type ()
const [inline], [noexcept], [inherited]
Convert to a string_view. Glow-down into a lighter, cuter form. π¦
Returns
A string_view.
References std::basic_string< _CharT, _Traits, _Alloc >::data(), and std::basic_string< _CharT, _Traits, _Alloc >::size().
π operator+= β appending a string_view
template<typename _CharT , typename _Traits , typename _Alloc >
template<typename _Tp > _If_sv< _Tp, basic_string & > std::basic_string<
_CharT, _Traits, _Alloc >::operator+= (const _Tp & __svt) [inline],
[inherited]
Append a string_view. Add it to the end, no big deal.
Parameters
__svtβ The object convertible tostring_viewto be appended.
Returns
Reference to this string.
References std::basic_string< _CharT, _Traits, _Alloc >::append().
π operator+= β appending a whole string
template<typename _CharT , typename _Traits , typename _Alloc > basic_string
& std::basic_string< _CharT, _Traits, _Alloc >::operator+= (const
basic_string< _CharT, _Traits, _Alloc > & __str) [inline], [inherited]
Append a string to this string. Two strings become one. Soulmate behaviour, fr fr. π«Ά
Parameters
__strβ The string to append.
Returns
Reference to this string.
References std::basic_string< _CharT, _Traits, _Alloc >::append().
π§ replace β iterator pair + string_view
template<typename _CharT , typename _Traits , typename _Alloc >
template<typename _Tp > _If_sv< _Tp, basic_string & > std::basic_string<
_CharT, _Traits, _Alloc >::replace (const_iterator __i1, const_iterator
__i2, const _Tp & __svt) [inline], [inherited]
Replace range of characters with string_view. Out with the old, in with the view. β¨
Parameters
__i1β An iterator referencing the start position to replace at.__i2β An iterator referencing the end position for the replace.__svtβ The object convertible tostring_viewto insert from.
Returns
Reference to this string.
References std::basic_string< _CharT, _Traits, _Alloc >::begin(), and std::basic_string< _CharT, _Traits, _Alloc >::replace().
πΈ replace() β the glow-up function, iterator edition π
template<typename _CharT , typename _Traits , typename _Alloc >
template<class _InputIterator >
basic_string & std::basic_string< _CharT, _Traits, _Alloc >::replace
(iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2)
[inline], [inherited]
Okay bestie, this one is literally "replace a range of characters with a range" β¨ β swapping out a chunk for a whole other chunk, no cap.
- Parameters
__i1β iterator pointing at the start of the range you're replacing.__i2β iterator pointing at the end of the range you're replacing.__k1β iterator pointing at the start of the range you're inserting.__k2β iterator pointing at the end of the range you're inserting.
- Returns β a reference to this string π«Ά
- Exceptions β
std::length_errorif the new length exceedsmax_size().
So what actually happens: the characters in the range [__i1,__i2) get removed. Then, in place, the characters in [__k1,__k2) get inserted. If the resulting length blows past max_size(), length_error is thrown. And the bestie-safe part: the value of the string doesn't change if an error is thrown π. Nothing half-done, nothing messy.
π replace() β same energy, but with a C string
template<typename _CharT , typename _Traits , typename _Alloc >
basic_string & std::basic_string< _CharT, _Traits, _Alloc >::replace
(iterator __i1, iterator __i2, const _CharT * __s) [inline], [inherited]
Replace a range of characters with a C string, iconic behaviour only.
- Parameters
__i1β iterator referencing start of range to replace.__i2β iterator referencing end of range to replace.__sβ the C string value to insert.
- Returns β reference to this string.
- Exceptions β
std::length_errorif new length exceedsmax_size().
Removes the characters in [__i1,__i2), and in place the characters of __s get inserted. Length overflow β length_error. Error thrown β string value untouched. Periodt.
References: std::basic_string< _CharT, _Traits, _Alloc >::replace().
π¦ replace() β the C substring one (now with a length count)
template<typename _CharT , typename _Traits , typename _Alloc >
basic_string & std::basic_string< _CharT, _Traits, _Alloc >::replace
(iterator __i1, iterator __i2, const _CharT * __s, size_type __n)
[inline], [inherited]
"Replace range of characters with C substring" β yes, that's the whole vibe.
- Parameters
__i1β iterator referencing start of range to replace.__i2β iterator referencing end of range to replace.__sβ C string value to insert.__nβ number of characters fromsto insert.
- Returns β reference to this string.
- Exceptions β
std::length_errorif new length exceedsmax_size().
Removes the characters in [__i1,__i2), then in place the first __n characters of __s get inserted. If the result is longer than max_size(), length_error gets yeeted at you. And once again: value unchanged if an error is thrown π.
References: std::basic_string< _CharT, _Traits, _Alloc >::replace().
π replace() β swapping in another basic_string
template<typename _CharT , typename _Traits , typename _Alloc >
basic_string & std::basic_string< _CharT, _Traits, _Alloc >::replace
(iterator __i1, iterator __i2,
const basic_string< _CharT, _Traits, _Alloc > & __str) [inline], [inherited]
Replace range of characters with string β simple, clean, slay.
- Parameters
__i1β iterator referencing start of range to replace.__i2β iterator referencing end of range to replace.__strβ string value to insert.
- Returns β reference to this string.
- Exceptions β
std::length_errorif new length exceedsmax_size().
Characters in [__i1,__i2) are gone, the value of __str slides in instead, and if that makes the length exceed max_size() you get a length_error. Error β string value stays exactly as it was, no notes.
References: std::basic_string< _CharT, _Traits, _Alloc >::replace(), and std::basic_string< _CharT, _Traits, _Alloc >::size().
π replace() β the initializer_list cutie
template<typename _CharT , typename _Traits , typename _Alloc >
basic_string & std::basic_string< _CharT, _Traits, _Alloc >::replace
(iterator __i1, iterator __i2, initializer_list< _CharT > __l)
[inline], [inherited]
Replace range of characters with initializer_list β feeding it a lil squad of chars π§ββοΈ
- Parameters
__i1β iterator referencing start of range to replace.__i2β iterator referencing end of range to replace.__lβ theinitializer_listof characters to insert.
- Returns β reference to this string.
- Exceptions β
std::length_errorif new length exceedsmax_size().
Removes the characters in [__i1,__i2). In place, characters in the range [__k1,__k2) are inserted. If the length of the result exceeds max_size(), length_error is thrown. The value of the string doesn't change if an error is thrown.
π okay real talk β yes, this overload's description literally mentions[__k1,__k2)even though this signature has no__k1/__k2anywhere. That's the docs' own copy-paste moment, so we're reporting it exactly as written, no edits, no gaslighting. Keeping it 100 with the source π
References: std::basic_string< _CharT, _Traits, _Alloc >::replace().
π₯ replace() β n copies of one character, the fill situation
template<typename _CharT , typename _Traits , typename _Alloc >
basic_string & std::basic_string< _CharT, _Traits, _Alloc >::replace
(iterator __i1, iterator __i2, size_type __n, _CharT __c)
[inline], [inherited]
Replace range of characters with multiple characters β¨
- Parameters
__i1β iterator referencing start of range to replace.__i2β iterator referencing end of range to replace.__nβ number of characters to insert.__cβ character to insert.
- Returns β reference to this string.
- Exceptions β
std::length_errorif new length exceedsmax_size().
Characters in [__i1,__i2) get removed, and in their place you get __n copies of __c. Length goes over max_size() β length_error. Error thrown β value stays put, untouched, immaculate.
π replace() β the string_view era (_If_sv, position + count version)
template<typename _CharT , typename _Traits , typename _Alloc >
template<typename _Tp >
_If_sv< _Tp, basic_string & > std::basic_string< _CharT, _Traits, _Alloc >::replace
(size_type __pos, size_type __n, const _Tp & __svt) [inline], [inherited]
Replace range of characters with string_view β flexible bestie energy π¦
- Parameters
__posβ the position to replace at.__nβ the number of characters to replace.__svtβ the object convertible tostring_viewto insert.
- Returns β reference to this string.
References: std::basic_string< _CharT, _Traits, _Alloc >::replace().
π replace() β position-based, string in, range out
template<typename _CharT , typename _Traits , typename _Alloc >
basic_string & std::basic_string< _CharT, _Traits, _Alloc >::replace
(size_type __pos, size_type __n,
const basic_string< _CharT, _Traits, _Alloc > & __str) [inline], [inherited]
Replace characters with value from another string β the classic β¨
- Parameters
__posβ index of first character to replace.__nβ number of characters to be replaced.__strβ string to insert.
- Returns β reference to this string.
- Exceptions
std::out_of_rangeif pos is beyond the end of this string.std::length_errorif new length exceedsmax_size().
Removes the characters in the range [__pos,__pos+__n) from this string, and in place the value of __str is inserted. If __pos is beyond the end of the string, out_of_range is thrown. If the length of the result exceeds max_size(), length_error is thrown. And the value of the string doesn't change if an error is thrown π.
References: std::basic_string< _CharT, _Traits, _Alloc >::replace(), and std::basic_string< _CharT, _Traits, _Alloc >::size().
Referenced by β okay this list is long, buckle up π’: std::basic_string< _CharT, _Traits, _Alloc >::append(), std::basic_string< _CharT, _Traits, _Alloc >::assign(), std::basic_string< _CharT, _Traits, _Alloc >::insert() (three times), and then std::basic_string< _CharT, _Traits, _Alloc >::replace() a full ten more times. Yeah. Ten. That's the whole overload set calling back home. Main character energy fr fr.
π«Ά replace() β string_view again, but with a source offset this time
template<typename _CharT , typename _Traits , typename _Alloc >
template<typename _Tp >
_If_sv< _Tp, basic_string & > std::basic_string< _CharT, _Traits, _Alloc >::replace
(size_type __pos1, size_type __n1, const _Tp & __svt, size_type __pos2,
size_type __n2 = npos) [inline], [inherited]
Replace range of characters with string_view β but picky about where in the view you start π
- Parameters
__pos1β the position to replace at.__n1β the number of characters to replace.__svtβ the object convertible tostring_viewto insert from.__pos2β the position in thestring_viewto insert from.__n2β the number of characters to insert.
- Returns β reference to this string.
References: std::basic_string< _CharT, _Traits, _Alloc >::replace().
π replace() β two positions, two counts, maximum drama
template<typename _CharT , typename _Traits , typename _Alloc >
basic_string & std::basic_string< _CharT, _Traits, _Alloc >::replace
(size_type __pos1, size_type __n1,
const basic_string< _CharT, _Traits, _Alloc > & __str,
size_type __pos2, size_type __n2 = npos) [inline], [inherited]
Replace characters with value from another string β the fully-specified version, iykyk πΈ
- Parameters
__pos1β index of first character to replace.__n1β number of characters to be replaced.__strβ string to insert.__pos2β index of first character of str to use.__n2β number of characters from str to use.
- Returns β reference to this string.
- Exceptions
std::out_of_rangeif__pos1 > size()or__pos2 > __str.size().std::length_errorif new length exceedsmax_size().
Removes the characters in the range [__pos1,__pos1 + n) from this string, and in place the value of __str is inserted. If __pos is beyond the end of the string, out_of_range is thrown. If the length of the result exceeds max_size(), length_error is thrown. The value of the string doesn't change if an error is thrown π.
References: std::basic_string< _CharT, _Traits, _Alloc >::replace().
π reserve() β the no-arg one, and it's a little plot twist
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>>
void std::basic_string< _CharT, _Traits, _Alloc >::reserve ()
Equivalent to shrink_to_fit().
That's it. That's the whole description. Not me expecting it to reserve anything π β no cap, it shrinks. Read it twice, bestie.
β reserve(size_type __res_arg) β this one actually reserves
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>>
void std::basic_string< _CharT, _Traits, _Alloc >::reserve (size_type __res_arg)
Attempt to preallocate enough memory for specified number of characters β the responsible, forward-thinking icon behaviour π
- Parameters
__res_argβ number of characters required.
- Exceptions β
std::length_errorif__res_argexceedsmax_size().
So this function attempts to reserve enough memory for the string to hold the specified number of characters. If the number you asked for is more than max_size(), length_error is thrown.
The advantage, and this is genuinely the good part: if optimal code is a necessity and you, the user, can determine the string length that will be required, you can reserve the memory in advance β and thus prevent a possible reallocation of memory and copying of string data. Chef's kiss. No more surprise realloc mid-loop. We love a plan π
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> basic_string< _CharT,
_Traits, _Alloc >::size_type std::basic_string< _CharT, _Traits, _Alloc
>::rfind (_CharT __c, size_type __pos = npos) const [noexcept]
find the last position of a character, bestie β¨ β this overload is on the hunt for one single character, and it goes backwards from __pos.
Parameters
__cβ the character you're locating π__posβ the index of the character to search back from (defaults to the end, obvs)
Returns
The index of the last occurrence. That's it, that's the tea.
Starting from __pos, it searches backward for __c within this string. Found it? Slay, you get the index where it was found. Not found? npos. Periodt. π
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> basic_string< _CharT,
_Traits, _Alloc >::size_type std::basic_string< _CharT, _Traits, _Alloc
>::rfind (const _CharT * __s, size_type __pos, size_type __n) const
[noexcept]
find the last position of a C substring π¦ β this one's like the character version but it's matching a whole little crew of __n characters.
Parameters
__sβ the C string to locate π―__posβ the index of the character to search back from__nβ how many characters fromsto search for (yes, the parameter doc literally sayss, we don't make the rules π« )
Returns
The index of the start of the last occurrence, gorgeous. π
Starting from __pos, it searches backward for the first __n characters in __s within this string. If found, it returns the index where it begins. If not found, it returns npos. No cap. π
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::rfind (const _CharT * __s,
size_type __pos = npos) const [inline], [noexcept]
find the last position of a C string πΈ β the whole-C-string edition, [inline] and [noexcept] because she's efficient and she does not throw.
Parameters
__sβ the C string to locate π__posβ the index of the character to start the search at (defaults to the end, iykyk)
Returns
The index of the start of the last occurrence. π
Starting from __pos, it searches backward for the value of __s within this string. Found it? Here's the index where it begins. Not found? npos. Same energy as always, fr fr.
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> template<typename _Tp >
_If_sv< _Tp, size_type > std::basic_string< _CharT, _Traits, _Alloc
>::rfind (const _Tp & __svt, size_type __pos = npos) const [inline],
[noexcept]
find the last position of a string_view π§ β template-on-template, she's fancy like that. Also [inline] and [noexcept].
Parameters
__svtβ the object convertible tostring_viewto locate π__posβ the index of the character to search back from (default end, bestie)
Returns
The index of the start of the last occurrence. π (That's all the docs give us on this one β no extra description, so I'm not gonna invent one, ngl.)
template<typename _CharT , typename _Traits , typename _Alloc > size_type
std::basic_string< _CharT, _Traits, _Alloc >::rfind (const basic_string<
_CharT, _Traits, _Alloc > & __str, size_type __pos = npos) const
[inline], [noexcept], [inherited]
find the last position of a string β β note the [inherited] tag, she got this from the base class and she's thriving.
Parameters
__strβ the string to locate π₯__posβ the index of the character to search back from (default end)
Returns
The index of the start of the last occurrence. π
Starting from __pos, it searches backward for the value of __str within this string. If found, it returns the index where it begins. If not found, it returns npos. π
References std::basic_string< _CharT, _Traits, _Alloc >::data(), std::basic_string< _CharT, _Traits, _Alloc >::rfind(), and std::basic_string< _CharT, _Traits, _Alloc >::size().
Referenced by std::basic_string< _CharT, _Traits, _Alloc >::find_last_of(), std::basic_string< _CharT, _Traits, _Alloc >::rfind(), std::basic_string< _CharT, _Traits, _Alloc >::rfind(), and std::basic_string< _CharT, _Traits, _Alloc >::rfind(). (Yes, rfind references rfind β it's giving recursion energy, we love to see it π)
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::rfind (const basic_string<
_CharT, _Traits, _Allocator > & __str, size_type __pos = npos) const
[inline], [noexcept]
find the last position of a string π¦ β the non-inherited twin, template params spelled the long way with _Allocator. [inline], [noexcept], iconic.
Parameters
__strβ the string to locate π__posβ the index of the character to search back from (default end)
Returns
The index of the start of the last occurrence. β¨
Starting from __pos, it searches backward for the value of __str within this string. If found, it returns the index where it begins. If not found, it returns npos.
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> size_type
std::basic_string< _CharT, _Traits, _Alloc >::size () const [inline],
[noexcept]
size() β returns the number of characters in the string, not including any null-termination. Luv, the null terminator is not being counted, it's not invited to the party. π [inline], [noexcept], tiny but mighty.
template<typename _CharT , typename _Traits , typename _Alloc > void
std::basic_string< _CharT, _Traits, _Alloc >::swap (basic_string<
_CharT, _Traits, _Alloc > & __s) [noexcept], [inherited]
swap contents with another string πΏ β [noexcept], [inherited], and honestly kind of a flex.
Parameters
__sβ the string to swap with π«Ά
Exchanges the contents of this string with that of __s in constant time. Constant time!! She's not copying anything, she's just swapping the vibes. ππ₯
Referenced by std::basic_string< _CharT, _Traits, _Alloc >::assign(), and std::basic_string< _CharT, _Traits, _Alloc >::operator=().
π«Ά MEMBER DATA DOCUMENTATION π«Ά
template<typename _CharT , typename _Traits = std::char_traits<_CharT>,
typename _Allocator = std::allocator<_CharT>> const basic_string<
_CharT, _Traits, _Alloc >::size_type std::basic_string< _CharT, _Traits,
_Alloc >::npos [static]
npos[static] β the value returned by various member functions when they fail. π She's the "it didn't work out babe" constant, the static queen of not-found, and we respect her.
π AUTHOR π
Generated automatically by Doxygen for libstdc++ from the source code. Not a human, just a little robot doing its absolute best. π€β¨
Ok bestie, that's the whole page, start to finish β every flag, every param, every npos, all of it. π
And for the sign-off: this lil' masterpiece is a libstdc++ man page, and the footer lexes as libst__gnu_debug::ba...s, _Allocator >(3cxx) (yes the name got absolutely bodied by truncation, she's mysterious now π). Take care of her, cite the version, and go write some strings. Mwah! π
ππ¦
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms