__GNU_CXX::__VERSA_STRING(3cxx)

okay so bestie, this is a 3cxx manual page, and it’s all about the template class __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base > πŸ’– yes the name is huge, we’re handling it.

🌸 NAME 🌸

__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base > β€” Template class __versa_string. that’s the whole NAME, short and iconic ✨

✨ SYNOPSIS ✨

to summon this thing, you literally type:

#include <vstring.h>

and it inherits from _Base< _CharT, _Traits, _Alloc > β€” yes, exactly like that, spaces and all 🫢

πŸŽ€ Public Types πŸŽ€

  • typedef _Alloc allocator_type β€” the allocator_type alias, serving its little typedef moment πŸ’…
  • typedef __gnu_cxx::__normal_iterator< const_pointer, __versa_string > const_iterator β€” const_iterator, no cap πŸ‘‘
  • typedef _CharT_alloc_traits::const_pointer const_pointer β€” the const_pointer typedef, right here bestie ✨
  • typedef const value_type & const_reference β€” const_reference, living that reference life πŸŽ€
  • typedef std::reverse_iterator< const_iterator > const_reverse_iterator β€” const_reverse_iterator, iconic reverse energy πŸ¦‹
  • typedef _CharT_alloc_type::difference_type difference_type β€” difference_type, periodt 🌸
  • typedef __gnu_cxx::__normal_iterator< pointer, __versa_string > iterator β€” iterator, main character typedef fr fr πŸ’œ
  • typedef _CharT_alloc_traits::pointer pointer β€” the pointer alias, slay πŸ”₯
  • typedef value_type & reference β€” reference, lowkey essential πŸ’–
  • typedef std::reverse_iterator< iterator > reverse_iterator β€” reverse_iterator, going backwards but make it cute πŸ™ˆ
  • typedef _CharT_alloc_type::size_type size_type β€” size_type, holding it down ⭐
  • typedef _Traits traits_type β€” traits_type, the vibes alias 🧚
  • typedef _Traits::char_type value_type β€” value_type, final typedef of this batch, and yes it ate πŸ’…

okay so we're deep in the member function list now and bestie there are SO many πŸ’… constructors first, because of course this class has like ten ways to be born. iconic behaviour honestly.

  • __versa_string (__versa_string &&__str) noexcept β€” the string move constructor. yes she moves, noexcept and everything, no cap ✨
  • template<class _InputIterator , typename = std::_RequireInputIter<_InputIterator>> __versa_string (_InputIterator __beg, _InputIterator __end, const _Alloc &__a=_Alloc()) β€” builds the string as a copy of a range, from __beg to __end, with the allocator defaulting to _Alloc() πŸ¦‹
  • __versa_string (const __versa_string &__str) β€” the classic copy constructor: construct a string with a copy of the value of __str πŸ’–
  • __versa_string (const __versa_string &__str, size_type __pos, size_type __n, const _Alloc &__a) β€” construct the string as a copy of a substring β€” you hand it the source, a __pos, an __n, and an allocator 🌸
  • __versa_string (const __versa_string &__str, size_type __pos, size_type __n=npos) β€” same substring-copy vibe, but __n defaults to npos so you can yeet it ☁️
  • __versa_string (const _Alloc &__a=_Alloc()) noexcept β€” construct an empty string using allocator a, and it's noexcept so she's calm πŸŽ€
  • __versa_string (const _CharT *__s, const _Alloc &__a=_Alloc()) β€” construct the string as a copy of a C string πŸ”₯
  • __versa_string (const _CharT *__s, size_type __n, const _Alloc &__a=_Alloc()) β€” construct a string initialized by a character array, __n characters of it, allocator optional πŸ’«
  • __versa_string (size_type __n, _CharT __c, const _Alloc &__a=_Alloc()) β€” construct the string as multiple characters: __n copies of __c. it's giving "repeat after me" 😌
  • __versa_string (std::initializer_list< _CharT > __l, const _Alloc &__a=_Alloc()) β€” construct the string from an initializer_list. brace-init girlies rise 🫢
  • ~__versa_string () noexcept β€” destroy the string instance. she's done, she's logging off, noexcept πŸ’€

  • template<typename _InputIterator > __versa_string< _CharT, _Traits, _Alloc, _Base > & _M_replace_dispatch (const_iterator __i1, const_iterator __i2, _InputIterator __k1, _InputIterator __k2, std::__false_type) β€” the page genuinely gives no blurb for this one, so I'm not inventing lore. signature only, bestie πŸ™ˆ

now the append era begins. big era.

  • template<class _InputIterator , typename = std::_RequireInputIter<_InputIterator>> __versa_string & append (_InputIterator __first, _InputIterator __last) β€” append a range of characters, __first through __last 🌈
  • __versa_string & append (const __versa_string &__str) β€” append a string to this string. she's stacking ✨
  • __versa_string & append (const __versa_string &__str, size_type __pos, size_type __n) β€” append a substring of __str, starting at __pos, __n long πŸ“
  • __versa_string & append (const _CharT *__s) β€” append a C string πŸ’…
  • __versa_string & append (const _CharT *__s, size_type __n) β€” append a C substring, __n chars of it πŸ¦‹
  • __versa_string & append (size_type __n, _CharT __c) β€” append multiple characters: __n copies of __c πŸ‘‘
  • __versa_string & append (std::initializer_list< _CharT > __l) β€” append an initializer_list of characters πŸ’œ

assign next, aka "no actually, be this instead":

  • __versa_string & assign (__versa_string &&__str) noexcept β€” set value to the contents of another string, via move. noexcept obviously ⭐
  • template<class _InputIterator , typename = std::_RequireInputIter<_InputIterator>> __versa_string & assign (_InputIterator __first, _InputIterator __last) β€” set value to a range of characters 🌸
  • __versa_string & assign (const __versa_string &__str) β€” set value to the contents of another string πŸ’–
  • __versa_string & assign (const __versa_string &__str, size_type __pos, size_type __n) β€” set value to a substring of a string, __pos and __n style πŸŽ€
  • __versa_string & assign (const _CharT *__s) β€” set value to the contents of a C string πŸ”₯
  • __versa_string & assign (const _CharT *__s, size_type __n) β€” set value to a C substring 😭
  • __versa_string & assign (size_type __n, _CharT __c) β€” set value to multiple characters: __n of __c ✨
  • __versa_string & assign (std::initializer_list< _CharT > __l) β€” set value to an initializer_list of characters 🧚

  • reference at (size_type __n) β€” provides access to the data contained in the string, at __n 🫢
  • const_reference at (size_type __n) const β€” same, but the const flavour πŸ’…
  • const_reference back () const noexcept β€” signature only, the page gives no blurb, so no invented lore from me πŸ™ˆ
  • reference back () noexcept β€” again, signature and nothing else πŸ’€
  • const_iterator begin () const noexcept β€” signature only 🌸
  • iterator begin () noexcept β€” signature only πŸ¦‹
  • const _CharT * c_str () const noexcept β€” return a const pointer to the null-terminated contents ⭐
  • size_type capacity () const noexcept β€” signature only, no blurb on the page πŸ’œ
  • const_iterator cbegin () const noexcept β€” signature only ✨
  • const_iterator cend () const noexcept β€” signature only πŸŽ€
  • void clear () noexcept β€” signature only, noexcept βœ…

the compare girlies. six of them. she's thorough.

  • int compare (const __versa_string &__str) const β€” compare to a string πŸ”
  • int compare (const _CharT *__s) const β€” compare to a C string πŸ”
  • int compare (size_type __pos, size_type __n, const __versa_string &__str) const β€” compare a substring to a string πŸ”
  • int compare (size_type __pos, size_type __n1, const _CharT *__s) const β€” compare a substring to a C string πŸ”
  • int compare (size_type __pos, size_type __n1, const _CharT *__s, size_type __n2) const β€” compare a substring against a character array, with __n1 and __n2 both in play 😀
  • int compare (size_type __pos1, size_type __n1, const __versa_string &__str, size_type __pos2, size_type __n2) const β€” compare a substring to a substring. yes, both sides get pos-and-n. it's giving ✨symmetry✨
  • size_type copy (_CharT *__s, size_type __n, size_type __pos=0) const β€” copy a substring into a C string, __n chars, __pos defaulting to 0 πŸ“

  • const_reverse_iterator crbegin () const noexcept β€” signature only, no blurb given 🌈
  • const_reverse_iterator crend () const noexcept β€” signature only πŸ’«
  • const _CharT * data () const noexcept β€” return a const pointer to the contents 🫢
  • bool empty () const noexcept β€” signature only ✨
  • const_iterator end () const noexcept β€” signature only πŸŽ€
  • iterator end () noexcept β€” signature only πŸ¦‹

erase hours 😀

  • iterator erase (const_iterator __first, const_iterator __last) β€” remove a range of characters, __first to __last πŸ’€
  • iterator erase (const_iterator __position) β€” remove one character at __position πŸ™ˆ
  • __versa_string & erase (size_type __pos=0, size_type __n=npos) β€” remove characters, with __pos defaulting to 0 and __n defaulting to npos πŸ”₯

now the search arc. the find family ate, honestly:

  • size_type find (_CharT __c, size_type __pos=0) const noexcept β€” find the position of a character, __pos defaults 0, noexcept πŸ”
  • size_type find (const __versa_string &__str, size_type __pos=0) const noexcept β€” find the position of a string πŸ”
  • size_type find (const _CharT *__s, size_type __pos, size_type __n) const β€” find the position of a C substring πŸ”
  • size_type find (const _CharT *__s, size_type __pos=0) const β€” find the position of a C string πŸ”

find_first_not_of β€” the contrarian queen πŸ‘‘

  • size_type find_first_not_of (_CharT __c, size_type __pos=0) const noexcept β€” find the position of a different character πŸ”
  • size_type find_first_not_of (const __versa_string &__str, size_type __pos=0) const noexcept β€” find the position of a character not in the string πŸ”
  • size_type find_first_not_of (const _CharT *__s, size_type __pos, size_type __n) const β€” find the position of a character not in a C substring πŸ”
  • size_type find_first_not_of (const _CharT *__s, size_type __pos=0) const β€” find the position of a character not in a C string πŸ”

find_first_of β€” back to the agreeable era ✨

  • size_type find_first_of (_CharT __c, size_type __pos=0) const noexcept β€” find the position of a character πŸ”
  • size_type find_first_of (const __versa_string &__str, size_type __pos=0) const noexcept β€” find the position of a character of the string πŸ”
  • size_type find_first_of (const _CharT *__s, size_type __pos, size_type __n) const β€” find the position of a character of a C substring πŸ”
  • size_type find_first_of (const _CharT *__s, size_type __pos=0) const β€” find the position of a character of a C string πŸ”

find_last_not_of β€” same energy, but from the BACK πŸ”™

  • size_type find_last_not_of (_CharT __c, size_type __pos=npos) const noexcept β€” find the last position of a different character, __pos defaults to npos πŸ”
  • size_type find_last_not_of (const __versa_string &__str, size_type __pos=npos) const noexcept β€” find the last position of a character not in the string πŸ”
  • size_type find_last_not_of (const _CharT *__s, size_type __pos, size_type __n) const β€” find the last position of a character not in a C substring πŸ”
  • size_type find_last_not_of (const _CharT *__s, size_type __pos=npos) const β€” find the last position of a character not in a C string πŸ”

find_last_of β€” closing out the search saga 🎬

  • size_type find_last_of (_CharT __c, size_type __pos=npos) const noexcept β€” find the last position of a character πŸ”
  • size_type find_last_of (const __versa_string &__str, size_type __pos=npos) const noexcept β€” find the last position of a character of the string πŸ”
  • size_type find_last_of (const _CharT *__s, size_type __pos, size_type __n) const β€” find the last position of a character of a C substring πŸ”
  • size_type find_last_of (const _CharT *__s, size_type __pos=npos) const β€” find the last position of a character of a C string πŸ”

  • const_reference front () const noexcept β€” signature only, no blurb 🫢
  • reference front () noexcept β€” signature only πŸ’…
  • allocator_type get_allocator () const noexcept β€” return a copy of the allocator used to construct this string πŸ’–

insert overloads, aka "let me just squeeze this in" 😌

  • iterator insert (const_iterator __p, _CharT __c) β€” insert one character at __p ✨
  • template<class _InputIterator , typename = std::_RequireInputIter<_InputIterator>> iterator insert (const_iterator __p, _InputIterator __beg, _InputIterator __end) β€” insert a range of characters at __p πŸ¦‹
  • iterator insert (const_iterator __p, size_type __n, _CharT __c) β€” insert multiple characters, __n of __c 🌸
  • iterator insert (const_iterator __p, std::initializer_list< _CharT > __l) β€” insert an initializer_list of characters πŸŽ€
  • __versa_string & insert (size_type __pos, const _CharT *__s) β€” insert a C string at __pos πŸ”₯
  • __versa_string & insert (size_type __pos, const _CharT *__s, size_type __n) β€” insert a C substring πŸ”₯
  • __versa_string & insert (size_type __pos, size_type __n, _CharT __c) β€” insert multiple characters πŸ’«
  • __versa_string & insert (size_type __pos1, const __versa_string &__str) β€” insert the value of a string at __pos1 πŸ’œ
  • __versa_string & insert (size_type __pos1, const __versa_string &__str, size_type __pos2, size_type __n) β€” insert a substring. positions on positions 😀

  • size_type length () const noexcept β€” returns the number of characters in the string, not including any null-termination πŸ“
  • size_type max_size () const noexcept β€” returns the size() of the largest possible string πŸ‘‘

operator era πŸ’…

  • __versa_string & operator+= (_CharT __c) β€” append a character 🌸
  • __versa_string & operator+= (const __versa_string &__str) β€” append a string to this string πŸ¦‹
  • __versa_string & operator+= (const _CharT *__s) β€” append a C string πŸŽ€
  • __versa_string & operator+= (std::initializer_list< _CharT > __l) β€” append an initializer_list of characters ✨
  • __versa_string & operator= (__versa_string &&__str) noexcept β€” the string move assignment operator. noexcept and unbothered πŸ’€
  • __versa_string & operator= (_CharT __c) β€” set value to a string of length 1 πŸ“
  • __versa_string & operator= (const __versa_string &__str) β€” assign the value of str to this string πŸ’–
  • __versa_string & operator= (const _CharT *__s) β€” copy the contents of __s into this string πŸ”₯
  • __versa_string & operator= (std::initializer_list< _CharT > __l) β€” set value to a string constructed from an initializer list 🌈
  • const_reference operator[] (size_type __pos) const noexcept β€” subscript access to the data contained in the string, const flavour ✨
  • reference operator[] (size_type __pos) noexcept β€” subscript access to the data contained in the string πŸ’…
  • void pop_back () β€” remove the last character. bye bestie πŸ‘‹
  • void push_back (_CharT __c) β€” append a single character 🫢
  • const_reverse_iterator rbegin () const noexcept β€” signature only, no blurb πŸ’œ
  • reverse_iterator rbegin () noexcept β€” signature only 🧚
  • const_reverse_iterator rend () const noexcept β€” signature only ⭐
  • reverse_iterator rend () noexcept β€” signature only 🌸

aaaaand we land on replace, where the page literally cuts itself off mid-signature:

  • __versa_string & replace (const_iterator __i1, const_iterator __i2, β€” and that's where this part of the page runs out of room 😭 signature's not finished, no blurb either, so we're picking this up right where it left off next time πŸŽ€

…_CharT *__k1, _CharT *__k2) β€” ok that's literally just the tail end of one of the replace overloads hanging out mid-signature, we're picking up right there bestie, no restart, no recap πŸ’–

  • template<class _InputIterator , typename = std::_RequireInputIter<_InputIterator>> __versa_string & replace (const_iterator __i1, const_iterator __i2, _InputIterator __k1, _InputIterator __k2) β€” replace range of characters with range ✨
  • __versa_string & replace (const_iterator __i1, const_iterator __i2, const __versa_string &__str) β€” replace range of characters with string
  • __versa_string & replace (const_iterator __i1, const_iterator __i2, const _CharT *__k1, const _CharT *__k2)
  • __versa_string & replace (const_iterator __i1, const_iterator __i2, const _CharT *__s) β€” replace range of characters with C string
  • __versa_string & replace (const_iterator __i1, const_iterator __i2, const _CharT *__s, size_type __n) β€” replace range of characters with C substring
  • __versa_string & replace (const_iterator __i1, const_iterator __i2, const_iterator __k1, const_iterator __k2)
  • __versa_string & replace (const_iterator __i1, const_iterator __i2, iterator __k1, iterator __k2)
  • __versa_string & replace (const_iterator __i1, const_iterator __i2, size_type __n, _CharT __c) β€” replace range of characters with multiple characters
  • __versa_string & replace (const_iterator __i1, const_iterator __i2, std::initializer_list< _CharT > __l) β€” replace range of characters with initializer_list
  • __versa_string & replace (size_type __pos, size_type __n, const __versa_string &__str) β€” replace characters with value from another string
  • __versa_string & replace (size_type __pos, size_type __n1, const _CharT *__s) β€” replace characters with value of a C string
  • __versa_string & replace (size_type __pos, size_type __n1, const _CharT *__s, size_type __n2) β€” replace characters with value of a C substring
  • __versa_string & replace (size_type __pos, size_type __n1, size_type __n2, _CharT __c) β€” replace characters with multiple characters
  • __versa_string & replace (size_type __pos1, size_type __n1, const __versa_string &__str, size_type __pos2, size_type __n2) β€” replace characters with value from another string

ok and yes, some of those have no little description attached in the source β€” the ones with nothing after them are just signature-and-vibes, I'm not gonna make up lore for them πŸ™ˆ

  • void reserve (size_type __res_arg=0) β€” attempt to preallocate enough memory for specified number of characters πŸ’…
  • void resize (size_type __n) β€” resizes the string to the specified number of characters
  • void resize (size_type __n, _CharT __c) β€” resizes the string to the specified number of characters
  • size_type rfind (_CharT __c, size_type __pos=npos) const noexcept β€” find last position of a character
  • size_type rfind (const __versa_string &__str, size_type __pos=npos) const noexcept β€” find last position of a string
  • size_type rfind (const _CharT *__s, size_type __pos, size_type __n) const β€” find last position of a C substring
  • size_type rfind (const _CharT *__s, size_type __pos=npos) const β€” find last position of a C string
  • void shrink_to_fit () noexcept β€” a non-binding request to reduce capacity() to size() (non-binding!! she might not listen, that's the whole point 🫢)
  • size_type size () const noexcept β€” returns the number of characters in the string, not including any null-termination
  • __versa_string substr (size_type __pos=0, size_type __n=npos) const β€” get a substring
  • void swap (__versa_string &__s) noexcept β€” swap contents with another string

πŸ¦‹ STATIC PUBLIC ATTRIBUTES πŸ¦‹

  • static const size_type npos β€” the value returned by various member functions when they fail. icon behavior honestly, she has one job and she does it πŸ’€

πŸ’œ DETAILED DESCRIPTION πŸ’œ

template<typename _CharT, typename _Traits, typename _Alloc, template<
    typename, typename, typename > class _Base>
class __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >

Template class __versa_string.

Data structure managing sequences of characters and character-like objects. that's it, that's the whole vibe check ✨


πŸŽ€ CONSTRUCTOR & DESTRUCTOR DOCUMENTATION πŸŽ€

the default one 🌸

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __gnu_cxx::__versa_string<
    _CharT, _Traits, _Alloc, _Base >::__versa_string (const _Alloc & __a =
    _Alloc()) [inline],  [explicit],  [noexcept]

Construct an empty string using allocator a. three badges at once β€” [inline], [explicit], [noexcept] β€” she's serving, we love a multi-tag queen πŸ‘‘

copy constructor πŸ’–

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __gnu_cxx::__versa_string<
    _CharT, _Traits, _Alloc, _Base >::__versa_string (const __versa_string<
    _CharT, _Traits, _Alloc, _Base > & __str) [inline]

Construct string with copy of value of __str.

Parameters

  • __str β€” source string.

move constructor πŸ¦‹

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __gnu_cxx::__versa_string<
    _CharT, _Traits, _Alloc, _Base >::__versa_string (__versa_string<
    _CharT, _Traits, _Alloc, _Base > && __str) [inline],  [noexcept]

String move constructor.

Parameters

  • __str β€” source string.

The newly-constructed string contains the exact contents of __str. The contents of __str are a valid, but unspecified string β€” so like, don't go reading __str afterwards expecting the same thing, she's moved out and living her new life 😭

initializer_list constructor πŸ“

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __gnu_cxx::__versa_string<
    _CharT, _Traits, _Alloc, _Base >::__versa_string (std::initializer_list<
    _CharT > __l, const _Alloc & __a = _Alloc()) [inline]

Construct string from an initializer list.

Parameters

  • __l β€” std::initializer_list of characters.
  • __a β€” allocator to use (default is default allocator).

substring constructors 🌈

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __gnu_cxx::__versa_string<
    _CharT, _Traits, _Alloc, _Base >::__versa_string (const __versa_string<
    _CharT, _Traits, _Alloc, _Base > & __str, size_type __pos, size_type __n
    = npos) [inline]

Construct string as copy of a substring.

Parameters

  • __str β€” source string.
  • __pos β€” index of first character to copy from.
  • __n β€” number of characters to copy (default remainder).

and the same thing but with an allocator, because she likes options:

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __gnu_cxx::__versa_string<
    _CharT, _Traits, _Alloc, _Base >::__versa_string (const __versa_string<
    _CharT, _Traits, _Alloc, _Base > & __str, size_type __pos, size_type
    __n, const _Alloc & __a) [inline]

Construct string as copy of a substring.

Parameters

  • __str β€” source string.
  • __pos β€” index of first character to copy from.
  • __n β€” number of characters to copy.
  • __a β€” allocator to use.

character array constructor πŸ’…

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __gnu_cxx::__versa_string<
    _CharT, _Traits, _Alloc, _Base >::__versa_string (const _CharT * __s,
    size_type __n, const _Alloc & __a = _Alloc()) [inline]

Construct string initialized by a character array.

Parameters

  • __s β€” source character array.
  • __n β€” number of characters to copy.
  • __a β€” allocator to use (default is default allocator).
NB: __s must have at least __n characters, '\0' has no special meaning. like, none. zero. don't come at her with your null terminator assumptions 🚨

C string constructor ⭐

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __gnu_cxx::__versa_string<
    _CharT, _Traits, _Alloc, _Base >::__versa_string (const _CharT * __s,
    const _Alloc & __a = _Alloc()) [inline]

Construct string as copy of a C string.

Parameters

  • __s β€” source C string.
  • __a β€” allocator to use (default is default allocator).

the "n copies of one character" constructor 🌸

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __gnu_cxx::__versa_string<
    _CharT, _Traits, _Alloc, _Base >::__versa_string (size_type __n, _CharT
    __c, const _Alloc & __a = _Alloc()) [inline]

Construct string as multiple characters.

Parameters

  • __n β€” number of characters.
  • __c β€” character to use.
  • __a β€” allocator to use (default is default allocator).

the iterator range constructor ✨

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> template<class
_InputIterator , typename  = std::_RequireInputIter<_InputIterator>>
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base
>::__versa_string (_InputIterator __beg, _InputIterator __end, const
_Alloc & __a = _Alloc()) [inline]

Construct string as copy of a range.

Parameters

  • __beg β€” start of range.
  • __end β€” end of range.
  • __a β€” allocator to use (default is default allocator).

destructor πŸ’€

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __gnu_cxx::__versa_string<
    _CharT, _Traits, _Alloc, _Base >::~__versa_string () [inline],
    [noexcept]

Destroy the string instance. bye bestie, [inline] and [noexcept] on the way out too, classy till the end 🫢


✨ MEMBER FUNCTION DOCUMENTATION ✨

append β€” the range one πŸ¦‹

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> template<class
_InputIterator , typename  = std::_RequireInputIter<_InputIterator>>
__versa_string & __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc,
_Base >::append (_InputIterator __first, _InputIterator __last) [inline]

Append a range of characters.

Parameters

  • __first β€” iterator referencing the first character to append.
  • __last β€” iterator marking the end of the range.

Returns β€” reference to this string.

Appends characters in the range [first,last) to this string.

References β€” __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace().

append β€” the whole-string one πŸ‘‘

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::append
(const __versa_string< _CharT, _Traits, _Alloc, _Base > & __str)
[inline]

Append a string to this string.

Parameters

  • __str β€” the string to append.

Returns β€” reference to this string.

References β€” __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

Referenced by β€” __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::append(), std::getline(), __gnu_cxx::operator+(), __gnu_cxx::operator+(), __gnu_cxx::operator+(), __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator+=(), __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator+=(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator+=(). she's a collaborator, everyone wants her on the track πŸ’…

append β€” the substring one πŸŽ€

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::append
(const __versa_string< _CharT, _Traits, _Alloc, _Base > & __str,
size_type __pos, size_type __n) [inline]

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.


ok that's where we're pausing, hold that thought, there's more append coming and I'm not done hyping her up 😭

Exceptions β€” std::out_of_range if pos is not a valid index.

This function appends __n characters from __str starting at __pos to this string. If __n is larger than the number of available characters in __str, the remainder of __str is appended. simple, clean, no cap πŸ’–

append β€” C string era πŸŽ€

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::append
    (const _CharT * __s) [inline]

Append a C string. yes bestie, just the whole string ✨

  • Parameters: __s β€” the C string to append.
  • Returns: reference to this string.

append β€” C substring edition πŸ¦‹

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::append
    (const _CharT * __s, size_type __n) [inline]

Append a C substring. a lil slice of the C string, iconic πŸ’…

  • Parameters: __s β€” the C string to append; __n β€” the number of characters to append.
  • Returns: reference to this string.

append β€” multiple characters, okay?? πŸ’€

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::append
    (size_type __n, _CharT __c) [inline]

Append multiple characters. we're literally just stacking copies πŸ“

  • Parameters: __n β€” the number of characters to append; __c β€” the character to use.
  • Returns: reference to this string.

Appends n copies of c to this string.

  • References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

append β€” initializer_list moment ✨

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::append
    (std::initializer_list< _CharT > __l) [inline]

Append an initializer_list of characters. the curly-brace girlies ate πŸŽ€

  • Parameters: __l β€” the initializer_list of characters to append.
  • Returns: reference to this string.
  • References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::append().

assign β€” move assignment but make it cute πŸ’–

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign
    (__versa_string< _CharT, _Traits, _Alloc, _Base > && __str) [inline],
    [noexcept]

Set value to contents of another string. moving, not copying β€” main character energy πŸ‘‘

  • 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.

  • References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::swap().

assign β€” range of characters 🌈

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> template<class
    _InputIterator , typename  = std::_RequireInputIter<_InputIterator>>
    __versa_string & __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc,
    _Base >::assign (_InputIterator __first, _InputIterator __last) [inline]

Set value to a range of characters. iterators in, vibes out πŸ¦‹

  • Parameters: __first β€” iterator referencing the first character to append; __last β€” iterator marking the end of the range.
  • Returns: reference to this string.

Sets value of string to characters in the range [first,last).

  • References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace().

assign β€” copy assignment, the classic πŸŽ€

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign
    (const __versa_string< _CharT, _Traits, _Alloc, _Base > & __str)
    [inline]

Set value to contents of another string. the copy-paste bestie we know and love πŸ’…

  • Parameters: __str β€” source string to use.
  • Returns: reference to this string.
  • Referenced by: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign(), __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator=(), __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator=(), __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator=(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator=().

assign β€” substring of a string πŸ“

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign
    (const __versa_string< _CharT, _Traits, _Alloc, _Base > & __str,
    size_type __pos, size_type __n) [inline]

Set value to a substring of a string. grab a chunk, leave the rest ✨

  • 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_range if __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 larger than the number of available characters in __str, the remainder of __str is used.

  • References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

assign β€” C string, but make it safe 🧚

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign
    (const _CharT * __s) [inline]

Set value to contents of a C string. copied, so no lingering dependence 🌸

  • Parameters: __s β€” the C string to use.
  • Returns: reference to this string.

This function sets the value of this string to the value of __s. The data is copied, so there is no dependence on __s once the function returns.

  • References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

assign β€” C substring, bestie sized πŸ¦‹

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign
    (const _CharT * __s, size_type __n) [inline]

Set value to a C substring. first __n characters, periodt πŸ’…

  • Parameters: __s β€” the C string to use; __n β€” number of characters to use.
  • Returns: reference to this string.

This function sets the value of this string to the first __n characters of __s. If __n is larger than the number of available characters in __s, the remainder of __s is used.

  • References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

assign β€” multiple characters, we love a repeat πŸ”₯

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign
    (size_type __n, _CharT __c) [inline]

Set value to multiple characters. __n copies of __c, no notes πŸŽ€

  • Parameters: __n β€” length of the resulting string; __c β€” the character to use.
  • Returns: reference to this string.

This function sets the value of this string to __n copies of character __c.

  • References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

assign β€” initializer_list assigns πŸ’–

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign
    (std::initializer_list< _CharT > __l) [inline]

Set value to an initializer_list of characters. curly braces stay winning ✨

  • Parameters: __l β€” the initializer_list of characters to assign.
  • Returns: reference to this string.
  • References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign().

at β€” the safe access era πŸ‘‘

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> reference
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::at
    (size_type __n) [inline]

Provides access to the data contained in the string. bounds-checked, because we're responsible 🫢

  • Parameters: __n β€” the index of the character to access.
  • Returns: read/write reference to the character.
  • Exceptions: std::out_of_range if __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.

  • References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

at const β€” same safety, no editing πŸ”’

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> const_reference
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::at
    (size_type __n) const [inline]

Provides access to the data contained in the string. read-only, look but don't touch πŸ’…

  • Parameters: __n β€” the index of the character to access.
  • Returns: read-only (const) reference to the character.
  • Exceptions: std::out_of_range if __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.

  • References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

back const β€” last character, but make it const πŸŽ€

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> const_reference
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::back ()
    const [inline],  [noexcept]

Returns a read-only (constant) reference to the data at the last element of the string. the final girlie, no changes allowed πŸ’–

  • References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator[](), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

back β€” last character, now with edits πŸ¦‹

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> reference
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::back ()
    [inline],  [noexcept]

Returns a read/write reference to the data at the last element of the string. last element said "let me be editable" ✨

  • References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator[](), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

begin const β€” first character, read-only 🌸

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> const_iterator
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::begin ()
    const [inline],  [noexcept]

Returns a read-only (constant) iterator that points to the first character in the string. peek only, bestie 🫢

begin β€” first character, full access πŸ‘‘

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> iterator
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::begin ()
    [inline],  [noexcept]

Returns a read/write iterator that points to the first character in the string. Unshares the string. the way that begin() unshares? iconic. πŸ’…

  • Referenced by: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::crend(), __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::rend(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::rend().

🌟 c_str() β€” the raw-pointer moment

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> const _CharT *
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::c_str ()
    const [inline],  [noexcept]

Returns a const pointer to the null-terminated contents πŸ’–. It's a handle to internal data β€” like, that's the string's actual luggage, not a copy, no cap.

⚠️ Do not modify it or, and I quote, "dire things may happen." Bestie the manpage said dire. Believe it. πŸ˜­πŸ’€

πŸ“¦ capacity() β€” how much room before the next glow-up

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> size_type
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::capacity ()
    const [inline],  [noexcept]

Returns the total number of characters that the string can hold before needing to allocate more memory ✨. Think of it as the size of the closet, not the number of outfits currently in it.

Referenced by __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::push_back(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::shrink_to_fit().


πŸ₯‡ cbegin() β€” read-only, first character

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> const_iterator
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::cbegin ()
    const [inline],  [noexcept]

Returns a read-only (constant) iterator that points to the first character in the string 🫢. Look, don't touch.


🏁 cend() β€” read-only, one past the end

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> const_iterator
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::cend ()
    const [inline],  [noexcept]

Returns a read-only (constant) iterator that points one past the last character in the string 🌸. Classic end-of-range icon behavior.

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().


🧹 clear() β€” the reset button

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> void
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::clear ()
    [inline],  [noexcept]

Erases the string, making it empty πŸŽ€. Fresh start energy. We love a blank slate.


βš–οΈ compare(const __versa_string& __str) β€” the O.G. comparison

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> int
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::compare
    (const __versa_string< _CharT, _Traits, _Alloc, _Base > & __str) const
    [inline]

Compare to a string.

Parameters

  • __str β€” String to compare against.

Returns

Integer < 0, 0, or > 0.

So here's the tea β˜•: you get an integer < 0 if this string is ordered before __str, 0 if their values are equivalent, or > 0 if this string is ordered after __str. It determines the effective length rlen of the strings to compare as the smallest of size() and str.size(). Then it compares the two strings by calling traits::compare(data(), str.data(),rlen). If the result of the comparison is nonzero it returns it, otherwise the shorter one is ordered first ✨.

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::data(), std::min(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

Referenced by __gnu_cxx::operator<(), __gnu_cxx::operator<(), __gnu_cxx::operator<(), __gnu_cxx::operator<=(), __gnu_cxx::operator<=(), __gnu_cxx::operator<=(), __gnu_cxx::operator>(), __gnu_cxx::operator>(), __gnu_cxx::operator>(), __gnu_cxx::operator>=(), __gnu_cxx::operator>=(), and __gnu_cxx::operator>=(). (Yes, three of each β€” the operators are thriving.)


βš–οΈ compare(const _CharT * __s) β€” string vs. C string

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> int
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::compare
    (const _CharT * __s) const

Compare to a C string πŸ’œ.

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 it returns it, otherwise the shorter one is ordered first 🌈.

References std::min().


βš–οΈ compare(size_type __pos, size_type __n, const __versa_string& __str) β€” substring vs. string

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> int
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::compare
    (size_type __pos, size_type __n, const __versa_string< _CharT, _Traits,
    _Alloc, _Base > & __str) const

Compare substring to a string πŸ¦‹.

Parameters

  • __pos β€” Index of first character of substring.
  • __n β€” Number of characters in substring.
  • __str β€” String to compare against.

Returns

Integer < 0, 0, or > 0.

Form the substring of this string from the __n characters starting at __pos. Returns an integer < 0 if the substring is ordered before __str, 0 if their values are equivalent, or > 0 if the substring is ordered after __str. Determines the effective length rlen of the strings to compare as the smallest of the length of the substring and __str.size(). The function then compares the two strings by calling traits::compare(substring.data(),str.data(),rlen). If the result of the comparison is nonzero it returns it, otherwise the shorter one is ordered first πŸ’«.

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::data(), std::min(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().


βš–οΈ compare(size_type __pos, size_type __n1, const _CharT * __s) β€” substring vs. C string

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> int
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::compare
    (size_type __pos, size_type __n1, const _CharT * __s) const

Compare substring to a C string πŸ“.

Parameters

  • __pos β€” Index of first character of substring.
  • __n1 β€” Number of characters in substring.
  • __s β€” C string to compare against.

Returns

Integer < 0, 0, or > 0.

Form the substring of this string from the __n1 characters starting at __pos. Returns an integer < 0 if the substring is ordered before __s, 0 if their values are equivalent, or > 0 if the substring is ordered after __s. Determines the effective length rlen of the strings to compare as the smallest of the length of the substring and the length of a string constructed from __s. The function then compares the two string by calling traits::compare(substring.data(),s,rlen). If the result of the comparison is nonzero it returns it, otherwise the shorter one is ordered first 🌸.

References std::min().


βš–οΈ compare(size_type __pos, size_type __n1, const _CharT * __s, size_type __n2)

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> int
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::compare
    (size_type __pos, size_type __n1, const _CharT * __s, size_type __n2)
    const

Compare substring against a character array 🧚.

Parameters

  • __pos β€” Index of first character of substring.
  • __n1 β€” Number of characters in substring.
  • __s β€” character array to compare against.
  • __n2 β€” Number of characters of s.

Returns

Integer < 0, 0, or > 0.

Form the substring of this string from the __n1 characters starting at __pos. Form a string from the first __n2 characters of __s. Returns an integer < 0 if this substring is ordered before the string from __s, 0 if their values are equivalent, or > 0 if this substring is ordered after the string from __s. Determines the effective length rlen of the strings to compare as the smallest of the length of the substring and __n2. The function then compares the two strings by calling traits::compare(substring.data(),__s,rlen). If the result of the comparison is nonzero it returns it, otherwise the shorter one is ordered first πŸ‘‘.

🚨 NB: __s must have at least n2 characters, \0 has no special meaning. Like, it does not stop at the null. Don't come crying to me when you read past your buffer, bestie. πŸ’€

References std::min().


βš–οΈ compare(size_type __pos1, size_type __n1, const __versa_string& __str, size_type __pos2, size_type __n2) β€” substring vs. substring, the double-feature

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> int
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::compare
    (size_type __pos1, size_type __n1, const __versa_string< _CharT,
    _Traits, _Alloc, _Base > & __str, size_type __pos2, size_type __n2)
    const

Compare substring to a substring ✨.

Parameters

  • __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 of str.
  • __n2 β€” Number of characters in substring of str.

Returns

Integer < 0, 0, or > 0.

Form the substring of this string from the __n1 characters starting at __pos1. Form the substring of __str from the __n2 characters starting at __pos2. Returns an integer < 0 if this substring is ordered before the substring of __str, 0 if their values are equivalent, or > 0 if this substring is ordered after the substring of __str. Determines the effective length rlen of the strings to compare as the smallest of the lengths of the substrings. The function then compares the two strings by calling traits::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 __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::data(), and std::min().


πŸ“€ copy(_CharT * __s, size_type __n, size_type __pos = 0) β€” dump it into a C string

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string< _CharT,
    _Traits, _Alloc, _Base >::size_type __gnu_cxx::__versa_string< _CharT,
    _Traits, _Alloc, _Base >::copy (_CharT * __s, size_type __n, size_type
    __pos = 0) const

Copy substring into C string πŸŽ€.

Parameters

  • __s β€” C string to copy value into.
  • __n β€” Number of characters to copy.
  • __pos β€” Index of first character to copy.

Returns

Number of characters actually copied.

Exceptions

  • std::out_of_range β€” If pos > size().

Copies up to __n characters starting at __pos into the C string s. If __pos is greater than size(), out_of_range is thrown 😭. That's the whole vibe: you get back how many characters actually got copied, so check your receipt.


πŸ”„ crbegin() β€” read-only, last character first

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> const_reverse_iterator
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::crbegin ()
    const [inline],  [noexcept]

Returns a read-only (constant) reverse iterator that points to the last character in the string. Iteration is done in reverse element order πŸ¦‹. Main character energy: enters from the back.

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::end().


πŸ”„ crend() β€” read-only, one before the first

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> const_reverse_iterator
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::crend ()
    const [inline],  [noexcept]

Returns a read-only (constant) reverse iterator that points to one before the first character in the string. Iteration is done in reverse element order 🌈. It's the mirror-universe cend(), and she's slaying.

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::begin().

🫢 data()

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
const _CharT *
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::data() const
[inline] [noexcept]

Okay bestie, this one hands you a const pointer to the contents ✨ β€” basically a handle straight into the internal data. And like...

⚠️ Do NOT modify it. The manpage literally says "Do not modify or dire things may happen." Dire!! 😭 That's not a vibe check, that's a threat. Hands off the internals, periodt.

Referenced by: __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::compare() (three times β€” all the compare() overloads), ::find(), ::find_first_not_of(), ::find_first_of(), ::find_last_of(), and __gnu_cxx::operator==() (both overloads).


πŸ¦‹ empty()

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
bool
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::empty() const
[inline] [noexcept]

Returns true if the string is empty β€” and it's exactly the same thing as *this == '', no cap πŸ’… So like, it's giving "is there anything in here or nah".

References: ::size().


🌸 end() β€” the const one

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
const_iterator
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::end() const
[inline] [noexcept]

Gives you a read-only (constant) iterator pointing one past the last character in the string πŸ‘‘ Classic "the end isn't actually the last character" situation, iykyk.

References: ::size().


πŸŽ€ end() β€” the non-const one

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
iterator
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::end()
[inline] [noexcept]

Same deal but you get a read/write iterator pointing one past the last character. Only extra detail: it unshares the string πŸ™ˆ (yes, before you get to poke at it, it makes sure the string is yours alone β€” main character energy, no sharing).

References: ::size().

Referenced by: ::crbegin(), ::rbegin(), and ::rbegin() again (there are two rbegin() overloads, bestie).


πŸ’œ erase(const_iterator __first, const_iterator __last)

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
iterator
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::erase(
    const_iterator __first, const_iterator __last) [inline]

Remove a whole range of characters πŸ”₯

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 character after removal.

It removes the characters in the range [first,last) from this string. And the glow-up safety guarantee: the value of the string doesn't change if an error is thrown ✨


🧚 erase(const_iterator __position)

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
iterator
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::erase(
    const_iterator __position) [inline]

Just one character, singular, no ensemble πŸ’…

Parameters

  • __position β€” iterator referencing the character to remove.

Returns: an iterator referencing the same location after removal.

Removes the character at __position from this string. And again, same promise: the value of the string doesn't change if an error is thrown 🫢


⭐ erase(size_type __pos = 0, size_type __n = npos)

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
__versa_string &
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::erase(
    size_type __pos = 0, size_type __n = npos) [inline]

The index-based erase, and it returns a reference to this string so you can keep chaining 😌

Parameters

  • __pos β€” index of first character to remove (default 0).
  • __n β€” number of characters to remove (default: the remainder).

Returns: reference to this string.

Exceptions

  • std::out_of_range β€” if __pos is beyond the end of this string.

So here's the tea: removes __n characters from this string starting at __pos. The length of the string is reduced by __n. If there are < __n characters to remove, the remainder of the string is truncated. If __p is beyond end of string, out_of_range is thrown 🚨 And (say it with me) the value of the string doesn't change if an error is thrown.

Referenced by: std::getline().


🌈 find(_CharT __c, size_type __pos = 0)

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::find(
    _CharT __c, size_type __pos = 0) const [noexcept]

Find the position of a single character πŸ”

Parameters

  • __c β€” character to locate.
  • __pos β€” index of character to search from (default 0).

Returns: index of the first occurrence.

Starting from __pos, it searches forward for __c within this string. Found it? Returns the index where it was found. Not found? Returns npos πŸ’€


πŸ“ find(const __versa_string& __str, size_type __pos = 0)

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
size_type
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::find(
    const __versa_string<_CharT, _Traits, _Alloc, _Base> & __str,
    size_type __pos = 0) const [inline] [noexcept]

Same hunt, but for a whole string πŸ‘‘

Parameters

  • __str β€” string to locate.
  • __pos β€” index of character to search from (default 0).

Returns: index of the start of the first occurrence.

Starting from __pos, searches forward for the value of __str within this string. If found, returns the index where it begins. If not found, returns npos.

References: ::data(), ::find(), and ::size().


πŸŽ€ find(const _CharT * __s, size_type __pos, size_type __n)

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::find(
    const _CharT * __s, size_type __pos, size_type __n) const

Now we're finding a C substring β€” notice there's no default for __pos or __n here, bestie, you're giving it all three 🫑

Parameters

  • __s β€” C string to locate.
  • __pos β€” index of character to search from.
  • __n β€” number of characters from __s to search for.

Returns: index of the start of the 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.

Referenced by: ::find(), ::find(), and ::find_first_of().


✨ find(const _CharT * __s, size_type __pos = 0)

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
size_type
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::find(
    const _CharT * __s, size_type __pos = 0) const [inline]

The C-string version, now with the __pos = 0 default restored, we love convenience πŸ’…

Parameters

  • __s β€” C string to locate.
  • __pos β€” index of character to search from (default 0).

Returns: index of the start of the 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.

References: ::find().


πŸ’€ find_first_not_of(_CharT __c, size_type __pos = 0)

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::
find_first_not_of(_CharT __c, size_type __pos = 0) const [noexcept]

The opposite hunt β€” find the position of a different character πŸ™ˆ

Parameters

  • __c β€” character to avoid.
  • __pos β€” index of character to search from (default 0).

Returns: index of the first occurrence.

Starting from __pos, searches forward for a character other than __c within this string. Found one? Returns the index where it was found. None? Returns npos.


🧚 find_first_not_of(const __versa_string& __str, size_type __pos = 0)

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
size_type
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::
find_first_not_of(
    const __versa_string<_CharT, _Traits, _Alloc, _Base> & __str,
    size_type __pos = 0) const [inline] [noexcept]

Find a character that is not in the given string πŸ‘‘

Parameters

  • __str β€” string containing characters to avoid.
  • __pos β€” index of character to search from (default 0).

Returns: index of the 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: ::data(), ::find_first_not_of(), and ::size().

Referenced by: ::find_first_not_of() and ::find_first_not_of() (two more overloads, it's a whole family 🫢).


πŸ”₯ find_first_not_of(const _CharT * __s, size_type __pos, size_type __n)

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::
find_first_not_of(
    const _CharT * __s, size_type __pos, size_type __n) const

Find a character not in a C substring β€” again, no defaults for __pos and __n, you're on your own for those two 😭

Parameters

  • __s β€” C string containing characters to avoid.
  • __pos β€” index of character to search from.
  • __n β€” number of characters from s to consider.

Returns: index of the 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 * __s, size_type __pos = 0)

template<typename _CharT, typename _Traits, typename _Alloc,
         template<typename, typename, typename> class _Base>
size_type
__gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>::
find_first_not_of(const _CharT * __s, size_type __pos = 0) const
[inline]

Find a character not in a C string, with the default __pos = 0 back where it belongs ✨

Parameters

  • __s β€” C string containing characters to avoid.
  • __pos β€” index of character to search from (default 0).

Returns: index of the 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.

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_first_not_of().


πŸ’… find_first_of β€” bestie, where's the first match?

🌸 find_first_of (_CharT __c, size_type __pos = 0) β€” const, [inline], [noexcept]

   template<typename _CharT , typename _Traits , typename _Alloc , template<
       typename, typename, typename > class _Base> size_type
       __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base
       >::find_first_of (_CharT __c, size_type __pos = 0) const [inline],
       [noexcept]

Find position of a character. Literally just one lil char hunt πŸ”

Parameters

  • __c β€” the character to locate, i.e. the one you're simping for.
  • __pos β€” index of the character to search from (default 0).

Returns β€” index of first occurrence. That's it, that's the whole vibe.

Starting from __pos, it searches forward for the character __c within this string. If found, returns the index where it was found. If not found, returns npos (sad girl hours 😭).

Note: equivalent to find(c, pos).

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find().


πŸ¦‹ find_first_of (const __versa_string& __str, size_type __pos = 0) β€” const, [inline], [noexcept]

   template<typename _CharT , typename _Traits , typename _Alloc , template<
       typename, typename, typename > class _Base> size_type
       __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base
       >::find_first_of (const __versa_string< _CharT, _Traits, _Alloc, _Base >
       & __str, size_type __pos = 0) const [inline],  [noexcept]

Find position of a character of string. Now we're hunting for any one of a whole squad of characters ✨

Parameters

  • __str β€” the string containing the characters to locate.
  • __pos β€” index of the character to search from (default 0).

Returns β€” index of first occurrence.

Starting from __pos, it searches forward for one of the characters of __str within this string. Found one? Returns the index. Nope, nothing? Returns npos.

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::data(), __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_first_of(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

Referenced by: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_first_of(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_first_of().


πŸŽ€ find_first_of (const _CharT* __s, size_type __pos, size_type __n)

   template<typename _CharT , typename _Traits , typename _Alloc , template<
       typename, typename, typename > class _Base> __versa_string< _CharT,
       _Traits, _Alloc, _Base >::size_type __gnu_cxx::__versa_string< _CharT,
       _Traits, _Alloc, _Base >::find_first_of (const _CharT * __s, size_type
       __pos, size_type __n) const

Find position of a character of C substring. Same energy, but you're telling it exactly how many characters to look at πŸ’…

Parameters

  • __s β€” string containing the characters to locate.
  • __pos β€” index of the character to search from.
  • __n β€” number of characters from s to search for.

Returns β€” index of first occurrence.

Starting from __pos, it searches forward 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_first_of (const _CharT* __s, size_type __pos = 0) β€” const, [inline]

   template<typename _CharT , typename _Traits , typename _Alloc , template<
       typename, typename, typename > class _Base> size_type
       __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base
       >::find_first_of (const _CharT * __s, size_type __pos = 0) const
       [inline]

Find position of a character of C string. The classic no-count version, she's convenient like that 🫢

Parameters

  • __s β€” string containing the characters to locate.
  • __pos β€” index of the character to search from (default 0).

Returns β€” index of first occurrence.

Starting from __pos, it searches forward for one of the characters of __s within this string. If found, returns the index where it was found. If not found, returns npos.

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_first_of().


πŸ‘‘ find_last_not_of β€” the "anything but that" girlie

πŸ’œ find_last_not_of (_CharT __c, size_type __pos = npos) β€” const, [noexcept]

   template<typename _CharT , typename _Traits , typename _Alloc , template<
       typename, typename, typename > class _Base> __versa_string< _CharT,
       _Traits, _Alloc, _Base >::size_type __gnu_cxx::__versa_string< _CharT,
       _Traits, _Alloc, _Base >::find_last_not_of (_CharT __c, size_type __pos
       = npos) const [noexcept]

Find last position of a different character. She's looking backwards and she's picky β€” not this one, literally anything else bestie πŸ™ˆ

Parameters

  • __c β€” character to avoid. (We don't do that here.)
  • __pos β€” index of the character to search back from (default end).

Returns β€” index of last occurrence.

Starting from __pos, it searches backward for a character other than __c within this string. If found, returns the index where it was found. If not found, returns npos.


⭐ find_last_not_of (const __versa_string& __str, size_type __pos = npos) β€” const, [inline], [noexcept]

   template<typename _CharT , typename _Traits , typename _Alloc , template<
       typename, typename, typename > class _Base> size_type
       __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base
       >::find_last_not_of (const __versa_string< _CharT, _Traits, _Alloc,
       _Base > & __str, size_type __pos = npos) const [inline],  [noexcept]

Find last position of a character not in string. Whole-string avoid list, we love a boundary 😌

Parameters

  • __str β€” string containing the characters to avoid.
  • __pos β€” index of the character to search back from (default end).

Returns β€” index of last occurrence.

Starting from __pos, it 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: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_last_not_of().

Referenced by: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_last_not_of(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_last_not_of().


🌈 find_last_not_of (const _CharT* __s, size_type __pos, size_type __n)

   template<typename _CharT , typename _Traits , typename _Alloc , template<
       typename, typename, typename > class _Base> __versa_string< _CharT,
       _Traits, _Alloc, _Base >::size_type __gnu_cxx::__versa_string< _CharT,
       _Traits, _Alloc, _Base >::find_last_not_of (const _CharT * __s,
       size_type __pos, size_type __n) const

Find last position of a character not in C substring. Bounded avoid-list, very demure, very mindful πŸŽ€

Parameters

  • __s β€” C string containing the characters to avoid.
  • __pos β€” index of the character to search back from.
  • __n β€” number of characters from s to consider.

Returns β€” index of last occurrence.

Starting from __pos, it 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 (const _CharT* __s, size_type __pos = npos) β€” const, [inline]

   template<typename _CharT , typename _Traits , typename _Alloc , template<
       typename, typename, typename > class _Base> size_type
       __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base
       >::find_last_not_of (const _CharT * __s, size_type __pos = npos) const
       [inline]

Find last position of a character not in C string. The low-effort version β€” just hand her the C string and go ✨

Parameters

  • __s β€” C string containing the characters to avoid.
  • __pos β€” index of the character to search back from (default end).

Returns β€” index of last occurrence.

Starting from __pos, it searches backward for a character not contained in __s within this string. If found, returns the index where it was found. If not found, returns npos.

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_last_not_of().


πŸ”₯ find_last_of β€” searching backwards for the moment

🌸 find_last_of (_CharT __c, size_type __pos = npos) β€” const, [inline], [noexcept]

   template<typename _CharT , typename _Traits , typename _Alloc , template<
       typename, typename, typename > class _Base> size_type
       __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base
       >::find_last_of (_CharT __c, size_type __pos = npos) const [inline],
       [noexcept]

Find last position of a character. One char, but from the back πŸ’…

Parameters

  • __c β€” character to locate.
  • __pos β€” index of the character to search back from (default end).

Returns β€” index of last occurrence.

Starting from __pos, it 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).

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::rfind().


πŸ¦‹ find_last_of (const __versa_string& __str, size_type __pos = npos) β€” const, [inline], [noexcept]

   template<typename _CharT , typename _Traits , typename _Alloc , template<
       typename, typename, typename > class _Base> size_type
       __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base
       >::find_last_of (const __versa_string< _CharT, _Traits, _Alloc, _Base >
       & __str, size_type __pos = npos) const [inline],  [noexcept]

Find last position of a character of string. Backwards hunt through a whole squad πŸŽ€

Parameters

  • __str β€” string containing the characters to locate.
  • __pos β€” index of the character to search back from (default end).

Returns β€” index of last occurrence.

Starting from __pos, it 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.

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::data(), __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_last_of(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

Referenced by: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_last_of(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_last_of().


🧚 find_last_of (const _CharT* __s, size_type __pos, size_type __n)

   template<typename _CharT , typename _Traits , typename _Alloc , template<
       typename, typename, typename > class _Base> __versa_string< _CharT,
       _Traits, _Alloc, _Base >::size_type __gnu_cxx::__versa_string< _CharT,
       _Traits, _Alloc, _Base >::find_last_of (const _CharT * __s, size_type
       __pos, size_type __n) const

Find last position of a character of C substring. Backwards, but only within the first __n chars of __s β€” boundaries are hot πŸ”₯

Parameters

  • __s β€” C string containing the characters to locate.
  • __pos β€” index of the character to search back from.
  • __n β€” number of characters from s to search for.

Returns β€” index of last occurrence.

Starting from __pos, it 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 (const _CharT* __s, size_type __pos = npos) β€” const, [inline]

   template<typename _CharT , typename _Traits , typename _Alloc , template<
       typename, typename, typename > class _Base> size_type
       __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base
       >::find_last_of (const _CharT * __s, size_type __pos = npos) const
       [inline]

Find last position of a character of C string. Give her the whole C string, she'll do the rest 🫢

Parameters

  • __s β€” C string containing the characters to locate.
  • __pos β€” index of the character to search back from (default end).

Returns β€” index of last occurrence.

Starting from __pos, it 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.

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_last_of().


πŸŽ€ front β€” the first character, main character energy

πŸ’– front β€” const, [inline], [noexcept]

   template<typename _CharT , typename _Traits , typename _Alloc , template<
       typename, typename, typename > class _Base> const_reference
       __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::front ()
       const [inline],  [noexcept]

Returns a read-only (constant) reference to the data at the first element of the string. Look, don't touch πŸ”’βœ¨

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator[]().


πŸ”“ front

   template<typename _CharT , typename _Traits , typename _Alloc , template<
       typename, typename, typename > class _Base> reference
       __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::front ()
       [inline],  [noexcept]

Returns a read/write reference to the data at the first element of the string. Now you can touch β€” go off, edit that first character πŸ’…πŸ”₯

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator[]().

(that trailing bit is just the receipts from the entry right above it, bestie β€” it references operator[], slay πŸ’…)


get_allocator πŸŽ€

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> allocator_type
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base
    >::get_allocator () const

[inline], [noexcept]

Returns a copy of the allocator that was used to construct this string. That's the whole thing β€” a little allocator souvenir πŸ’–


insert β€” one single character 🌸

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> iterator
    __gnu_cxx::__versa_string< _CharT, _Traits , _Alloc, _Base >::insert
    (const_iterator __p, _CharT __c)

[inline]

Inserts exactly one character. Lowkey the simplest insert there is ✨

Parameters

  • __p β€” iterator referencing the position in the string to insert at.
  • __c β€” the character to insert.

Returns

  • Iterator referencing the newly inserted char. 🫢

Exceptions

  • std::length_error β€” if the new length exceeds max_size().

So: it inserts __c at the position referenced by __p. If adding that character makes the length exceed max_size(), length_error gets thrown. And if __p is beyond end of string, out_of_range is thrown. Either way, the value of the string doesn't change if an error is thrown β€” she's not messy like that πŸ’…


insert β€” a whole range of characters πŸ¦‹

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> template<class
    _InputIterator , typename  = std::_RequireInputIter<_InputIterator>>
    iterator __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base
    >::insert (const_iterator __p, _InputIterator __beg, _InputIterator
    __end)

[inline]

Inserts a range of characters. Group-chat energy: bring the whole squad in 😌

Parameters

  • __p β€” const_iterator referencing the location in the string to insert at.
  • __beg β€” start of range.
  • __end β€” end of range.

Returns

  • Iterator referencing the first inserted char.

Exceptions

  • std::length_error β€” if the new length exceeds max_size().

It inserts the characters in the range [beg,end). If adding those characters makes the length exceed max_size(), length_error is thrown. And bestie, the value of the string doesn't change if an error is thrown β€” no half-finished edits, periodt.

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace().


insert β€” multiple characters, iterator edition πŸŽ€

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> iterator
    __gnu_cxx::__versa_string< _CharT, _Traits , _Alloc, _Base >::insert
    (const_iterator __p, size_type __n, _CharT __c)

[inline]

Inserts multiple copies of one character. It's giving "copy paste but make it C++" πŸ’–

Parameters

  • __p β€” const_iterator referencing the location in the string to insert at.
  • __n β€” number of characters to insert.
  • __c β€” the character to insert.

Returns

  • Iterator referencing the first inserted char.

Exceptions

  • std::length_error β€” if the new length exceeds max_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. And yep β€” the value of the string doesn't change if an error is thrown.

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace().

Referenced by __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::insert().


insert β€” initializer_list edition πŸ“

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> iterator
    __gnu_cxx::__versa_string< _CharT, _Traits , _Alloc, _Base >::insert
    (const_iterator __p, std::initializer_list< _CharT > __l)

[inline]

Inserts an initializer_list of characters. Curly braces girlies, this one's for you ✨

Parameters

  • __p β€” const_iterator referencing the location in the string to insert at.
  • __l β€” the initializer_list of characters to insert.

Returns

  • Iterator referencing the first inserted char.

Exceptions

  • std::length_error β€” if the new length exceeds max_size().

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::insert().


insert β€” a C string goes in 🌈

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::insert
    (size_type __pos, const _CharT * __s)

[inline]

Inserts a C string. Classic, iconic, no notes πŸ’€

Parameters

  • __pos β€” iterator referencing the location in the string to insert at.
  • __s β€” the C string to insert.

Returns

  • Reference to this string.

Exceptions

  • std::length_error β€” if the new length exceeds max_size().
  • std::out_of_range β€” if __pos is beyond the end of this string.

It inserts the first __n characters of __s, starting at __pos. If adding characters causes the length to exceed max_size(), length_error is thrown. If __pos is beyond end(), out_of_range is thrown. And fr fr β€” the value of the string doesn't change if an error is thrown.

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace().


insert β€” a C substring, with a length this time 🧚

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::insert
    (size_type __pos, const _CharT * __s, size_type __n)

[inline]

Inserts a C substring. Same vibe, but you tell her exactly how many chars to take πŸŽ€

Parameters

  • __pos β€” iterator referencing the location in the string to insert at.
  • __s β€” the C string to insert.
  • __n β€” the number of characters to insert.

Returns

  • Reference to this string.

Exceptions

  • std::length_error β€” if the new length exceeds max_size().
  • std::out_of_range β€” if __pos is beyond the end of this string.

Inserts the first __n characters of __s, starting at __pos. If adding characters causes the length to exceed max_size(), length_error is thrown. If __pos is beyond end(), out_of_range is thrown. And again, bestie: the value of the string doesn't change if an error is thrown πŸ’œ

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace().


insert β€” n copies of a char at an index πŸ‘‘

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::insert
    (size_type __pos, size_type __n, _CharT __c)

[inline]

Insert multiple characters, but this time you're working with an index instead of an iterator. Main character energy πŸ”₯

Parameters

  • __pos β€” index in string to insert at.
  • __n β€” number of characters to insert.
  • __c β€” the character to insert.

Returns

  • Reference to this string.

Exceptions

  • std::length_error β€” if the new length exceeds max_size().
  • std::out_of_range β€” if __pos is beyond the end of this string.

Inserts __n copies of character __c, starting at index __pos. If adding characters causes the length to exceed max_size(), length_error is thrown. If __pos > length(), out_of_range is thrown. And yup β€” the value of the string doesn't change if an error is thrown ✨


insert β€” jam a whole string in there πŸ’–

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::insert
    (size_type __pos1, const __versa_string< _CharT, _Traits, _Alloc, _Base
    > & __str)

[inline]

Inserts the value of a string. String-ception, we love to see it πŸ¦‹

Parameters

  • __pos1 β€” iterator referencing the location in the string to insert at.
  • __str β€” the string to insert.

Returns

  • Reference to this string.

Exceptions

  • std::length_error β€” if the new length exceeds max_size().

Inserts the value of __str, starting at __pos1. If adding characters causes the length to exceed max_size(), length_error is thrown. And obviously β€” the value of the string doesn't change if an error is thrown πŸ’…

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().


insert β€” the full substring situation 🌸

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::insert
    (size_type __pos1, const __versa_string< _CharT, _Traits, _Alloc, _Base
    > & __str, size_type __pos2, size_type __n)

[inline]

Inserts a substring β€” the most specific of the insert girlies and honestly? Obsessed πŸŽ€

Parameters

  • __pos1 β€” iterator referencing the location in the string to insert at.
  • __str β€” the string to insert.
  • __pos2 β€” start of characters in str to insert.
  • __n β€” number of characters to insert.

Returns

  • Reference to this string.

Exceptions

  • std::length_error β€” if the new length exceeds max_size().
  • std::out_of_range β€” if __pos1 > 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. And yes, one more time for the people in the back: the value of the string doesn't change if an error is thrown πŸ‘‘

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace().


length 🧚

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> size_type
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::length ()
    const

[inline], [noexcept]

Returns the number of characters in the string β€” not including any null-termination. That null terminator is not invited to the count πŸ’…


max_size ⭐

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> size_type
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::max_size ()
    const

[inline], [noexcept]

Returns the size() of the largest possible string. Big "how much can she hold" energy 🌈

Referenced by std::getline().


operator+= β€” append a character πŸ“

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator+=
    (_CharT __c)

[inline]

Appends a single character. Tiny little add, big little slay ✨

Parameters

  • __c β€” the character to append.

Returns

  • Reference to this string.

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::push_back().


operator+= β€” append a string 🫢

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator+=
    (const __versa_string< _CharT, _Traits, _Alloc, _Base > & __str)

[inline]

Appends a string to this string. Two strings becoming one, it's giving soulmate behaviour πŸ’–

Parameters

  • __str β€” the string to append.

Returns

  • Reference to this string.

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::append().


operator+= β€” append a C string πŸ¦‹

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator+=
    (const _CharT * __s)

[inline]

Appends a C string. The OG char pointer gets to join the party too 😌

Parameters

  • __s β€” the C string to append.

Returns

  • Reference to this string.

References __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::append().

πŸ’… operator+= (the initializer_list one)

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator+=
(std::initializer_list< _CharT > __l) [inline]

okay so this one just appends an entire initializer_list of characters onto your string, bestie ✨

  • Parameters β€” __l: the initializer_list of characters you're slapping on the end.
  • Returns β€” a reference to this string. 🫢

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::append().


🚚 operator= (move assignment)

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator=
(__versa_string< _CharT, _Traits, _Alloc, _Base > && __str) [inline],
[noexcept]

the string move assignment operator, and she's noexcept so she's not about to throw hands 😌

  • Parameters β€” __str: the source string.

the contents of __str get moved into this string β€” without copying, periodt. and after that, __str is described as a valid, but unspecified string. (translation: don't go poking at it expecting the old contents, she's been through something πŸ™ˆ)

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::swap().


πŸ”€ operator= (single character)

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator=
(_CharT __c) [inline]

set the value to a string of length 1. literally one character era πŸ’…

  • Parameters β€” __c: the source character.

assigning to a character makes this string length 1, and (*this)[0] == __c. no cap.

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign().


πŸ“‹ operator= (copy assignment)

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator=
(const __versa_string< _CharT, _Traits, _Alloc, _Base > & __str) [inline]

assign the value of str to this string. the classic. the icon. 🌸

  • Parameters β€” __str: the source string.

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign().


πŸͺ’ operator= (C string)

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator=
(const _CharT * __s) [inline]

copy the contents of __s into this string πŸ¦‹

  • Parameters β€” __s: source null-terminated string.

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign().


πŸŽ€ operator= (initializer_list)

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator=
(std::initializer_list< _CharT > __l) [inline]

sets the value to a string constructed from an initializer list ✨

  • Parameters β€” __l: std::initializer_list.

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign().


πŸ” operator[] (const version)

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> const_reference
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator[]
(size_type __pos) const [inline], [noexcept]

subscript access to the data inside the string β€” the read-only, behave-yourself version πŸ‘‘

  • Parameters β€” __pos: the index of the character you want to access.
  • Returns β€” a read-only (constant) reference to that character.

this operator gives you easy, array-style, data access. but β€” and this is the important bit, bestie β€” data access with this operator is unchecked, and out_of_range lookups are not defined. 😭 (for checked lookups, go see at().)

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

Referenced by: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::back(), __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::back(), __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::front(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::front().


πŸ”“ operator[] (the read/write one)

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> reference
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator[]
(size_type __pos) [inline], [noexcept]

subscript access to the data inside the string, but this time you get to write πŸ’…

  • Parameters β€” __pos: the index of the character you're accessing.
  • Returns β€” a read/write reference to the character.

same deal as above: easy, array-style, data access. and again β€” data access with this operator is unchecked, out_of_range lookups are not defined, and for checked lookups you want at(). one extra thing: this version unshares the string πŸ”₯

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().


βœ‚οΈ pop_back

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> void
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::pop_back ()
[inline]

removes the last character. and heads up: the string must be non-empty ⚠️ don't come crying to me if you pop an empty string, I warned you.

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().


βž• push_back

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> void
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::push_back
(_CharT __c) [inline]

appends a single character. tiny little addition, huge slay πŸŽ€

  • Parameters β€” __c: the character to append.

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::capacity(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().

Referenced by: __gnu_cxx::operator+(), __gnu_cxx::operator+(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator+=().


πŸ”™ rbegin (const)

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> const_reverse_iterator
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::rbegin ()
const [inline], [noexcept]

returns a read-only (constant) reverse iterator pointing at the last character in the string. iteration happens in reverse element order, which is exactly the vibe πŸ¦‹

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::end().


πŸ”„ rbegin (read/write)

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> reverse_iterator
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::rbegin ()
[inline], [noexcept]

returns a read/write reverse iterator pointing at the last character in the string. iteration is in reverse element order. and yes β€” it unshares the string πŸ’…

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::end().


🏁 rend (const)

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> const_reverse_iterator
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::rend ()
const [inline], [noexcept]

returns a read-only (constant) reverse iterator pointing to one before the first character in the string. iteration's in reverse element order, as always ✨

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::begin().


🎬 rend (read/write)

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> reverse_iterator
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::rend ()
[inline], [noexcept]

returns a read/write reverse iterator pointing to one before the first character in the string. reverse element order, obviously. and it unshares the string 🌸

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::begin().


🩹 replace β€” range with range

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> template<class
_InputIterator , typename = std::_RequireInputIter<_InputIterator>>
__versa_string & __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base
>::replace (const_iterator __i1, const_iterator __i2, _InputIterator __k1,
_InputIterator __k2) [inline]

replace a range of characters with another range β€” the swap-your-whole-situation move 😌

  • Parameters
    • __i1: iterator referencing the start of the range to replace.
    • __i2: iterator referencing the end of the range to replace.
    • __k1: iterator referencing the start of the range to insert.
    • __k2: iterator referencing the end of the range to insert.
  • Returns β€” a reference to this string.
  • Exceptions β€” std::length_error if the new length exceeds max_size().

here's the tea: it removes the characters in the range [i1,i2), and in place the characters in the range [k1,k2) get inserted. if the resulting length exceeds max_size(), length_error gets thrown. and good news β€” the value of the string doesn't change if an error is thrown 🫢


🩹 replace β€” range with string

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace
(const_iterator __i1, const_iterator __i2, const __versa_string< _CharT,
_Traits, _Alloc, _Base > & __str) [inline]

replace a range of characters with an entire string πŸ‘‘

  • Parameters
    • __i1: iterator referencing the start of the range to replace.
    • __i2: iterator referencing the end of the range to replace.
    • __str: the string value to insert.
  • Returns β€” a reference to this string.
  • Exceptions β€” std::length_error if the new length exceeds max_size().

it removes the characters in [i1,i2) and, in place, inserts the value of __str. if the result is longer than max_size(), length_error is thrown. the string's value stays untouched if an error is thrown πŸ’–

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace(), and __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size().


🩹 replace β€” range with C string

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace
(const_iterator __i1, const_iterator __i2, const _CharT * __s) [inline]

replace a range of characters with a C string ✨

  • Parameters
    • __i1: iterator referencing the start of the range to replace.
    • __i2: iterator referencing the end of the range to replace.
    • __s: the C string value to insert.
  • Returns β€” a reference to this string.
  • Exceptions β€” std::length_error if the new length exceeds max_size().

kicks out the characters in [i1,i2) and drops in the characters of __s in their place. over max_size()? that's a length_error. and if an error's thrown, the string value does not change πŸ™ˆ

References: __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace().


🩹 replace β€” range with C substring

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
__gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace
(const_iterator __i1, const_iterator __i2, const _CharT * __s, size_type
__n) [inline]

replace a range of characters with a C substring β€” yes, she takes an __n too, she's thorough πŸŽ€

Parameters 🌸

  • __i1 β€” iterator pointing at the start of the range you're replacing. Like, where the swap-out begins, bestie.
  • __i2 β€” iterator pointing at the end of that range. One past the last character getting yeeted.
  • __s β€” the C string value you're inserting. πŸŽ€
  • __n β€” number of characters from s to insert.

Returns πŸ’–

Reference to this string. Chaining vibes, fr fr.

Exceptions 😭

  • std::length_error β€” if the new length exceeds max_size().

Removes the characters in the range [i1,i2). In place, the first n characters of __s are inserted. If the length of result exceeds max_size(), length_error is thrown. The value of the string doesn't change if an error is thrown.

References πŸ”—

  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace().

✨ another replace overload: iterator range + count + character ✨

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace
    (const_iterator __i1, const_iterator __i2, size_type __n, _CharT __c)
    [inline]

Replace range of characters with multiple characters. Iconic behavior, no cap.

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_error β€” if new length exceeds max_size().

Removes the characters in the range [i1,i2). In place, __n copies of __c are inserted. If the length of result exceeds max_size(), length_error is thrown. The value of the string doesn't change if an error is thrown.


🌈 replace overload: iterator range + initializer_list 🌈

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace
    (const_iterator __i1, const_iterator __i2, std::initializer_list< _CharT
    > __l) [inline]

Replace range of characters with initializer_list. Very cute, very curated. πŸŽ€

Parameters 🌸

  • __i1 β€” iterator referencing start of range to replace.
  • __i2 β€” iterator referencing end of range to replace.
  • __l β€” the initializer_list of characters to insert.

Returns πŸ’–

Reference to this string.

Exceptions 😭

  • std::length_error β€” if new length exceeds max_size().

Removes the characters in the range [i1,i2). In place, characters in the range [k1,k2) are inserted. If the length of result exceeds max_size(), length_error is thrown. The value of the string doesn't change if an error is thrown.

References πŸ”—

  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace().

πŸ¦‹ replace overload: index + count + another string πŸ¦‹

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace
    (size_type __pos, size_type __n, const __versa_string< _CharT, _Traits,
    _Alloc, _Base > & __str) [inline]

Replace characters with value from another string. It's giving copy-paste but make it C++.

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_range β€” if __pos is beyond the end of this string.
  • std::length_error β€” if new length exceeds max_size().

Removes the characters in the range [pos,pos+n) from this string. In place, the value of __str is inserted. If __pos is beyond end of 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 πŸ”—

  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size()

Referenced by (yes, all of these, no cap) πŸ”₯

  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::append()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::insert()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::insert()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::insert()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::insert()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::insert()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::insert()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace()

πŸ“ replace overload: index + count + C string πŸ“

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace
    (size_type __pos, size_type __n1, const _CharT * __s) [inline]

Replace characters with value of a C string. Very main character, very null-terminated. ✨

Parameters πŸŽ€

  • __pos β€” index of first character to replace.
  • __n1 β€” number of characters to be replaced.
  • __s β€” C string to insert.

Returns πŸ’–

Reference to this string.

Exceptions 😭

  • std::out_of_range β€” if __pos > size().
  • std::length_error β€” if new length exceeds max_size().

Removes the characters in the range [pos,pos + n1) from this string. In place, the characters of __s are inserted. If pos is beyond end of string, out_of_range is thrown. If the length of result exceeds max_size(), length_error is thrown.

The value of the string doesn't change if an error is thrown.

References πŸ”—

  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace().

πŸ’œ replace overload: index + count + C substring + count πŸ’œ

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace
    (size_type __pos, size_type __n1, const _CharT * __s, size_type __n2)
    [inline]

Replace characters with value of a C substring. It's giving "only take the first few chars, bestie." πŸ¦‹

Parameters 🌸

  • __pos β€” index of first character to replace.
  • __n1 β€” number of characters to be replaced.
  • __s β€” C string to insert.
  • __n2 β€” number of characters from __s to use.

Returns 🫢

Reference to this string.

Exceptions 😭

  • std::out_of_range β€” if __pos1 > size().
  • std::length_error β€” if new length exceeds max_size().

Removes the characters in the range [pos,pos + n1) from this string. In place, the first __n2 characters of __s are inserted, or all of __s if __n2 is too large. If __pos is beyond end of string, out_of_range is thrown. If the length of result exceeds max_size(), length_error is thrown. The value of the string doesn't change if an error is thrown.


⭐ replace overload: index + counts + character ⭐

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace
    (size_type __pos, size_type __n1, size_type __n2, _CharT __c) [inline]

Replace characters with multiple characters. Same char, multiple times. We love a repeat moment. πŸ’…

Parameters 🌟

  • __pos β€” index of first character to replace.
  • __n1 β€” number of characters to be replaced.
  • __n2 β€” number of characters to insert.
  • __c β€” character to insert.

Returns πŸ’–

Reference to this string.

Exceptions 😭

  • std::out_of_range β€” if __pos > size().
  • std::length_error β€” if new length exceeds max_size().

Removes the characters in the range [pos,pos + n1) from this string. In place, __n2 copies of __c are inserted. If __pos is beyond end of string, out_of_range is thrown. If the length of result exceeds max_size(), length_error is thrown. The value of the string doesn't change if an error is thrown.


🌈 replace overload: index + count + string + index + count 🌈

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string &
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace
    (size_type __pos1, size_type __n1, const __versa_string< _CharT,
    _Traits, _Alloc, _Base > & __str, size_type __pos2, size_type __n2)
    [inline]

Replace characters with value from another string. This one takes a whole little slice of __str, 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_range β€” if __pos1 > size() or __pos2 > str.size().
  • std::length_error β€” if new length exceeds max_size().

Removes the characters in the range [pos1,pos1 + n) from this string. In place, the value of __str is inserted. If __pos is beyond end of 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 πŸ”—

  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace().

πŸŽ€ reserve β€” preallocate like a planner πŸŽ€

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> void
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::reserve
    (size_type __res_arg = 0) [inline]

Attempt to preallocate enough memory for specified number of characters. Future-proofing vibes, honestly. ✨

Parameters 🌸

  • __res_arg β€” number of characters required.

Exceptions 😭

  • std::length_error β€” if __res_arg exceeds max_size().

This function attempts to reserve enough memory for the string to hold the specified number of characters. If the number requested is more than max_size(), length_error is thrown.

The advantage of this function is that if optimal code is a necessity and the user can determine the string length that will be required, the user can reserve the memory in advance, and thus prevent a possible reallocation of memory and copying of string data.

Referenced by πŸ”₯

  • __gnu_cxx::operator+()
  • __gnu_cxx::operator+()
  • __gnu_cxx::operator+()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::shrink_to_fit()

πŸ¦‹ resize β€” change the character count πŸ¦‹

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> void
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::resize
    (size_type __n) [inline]

Resizes the string to the specified number of characters. Glow-up or shrink-down, either way. πŸ’–

Parameters 🌟

  • __n β€” number of characters the string should contain.

This function will resize the string to the specified length. If the new size is smaller than the string's current size the string is truncated, otherwise the string is extended and new characters are default-constructed. For basic types such as char, this means setting them to 0.

References πŸ”—

  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::resize().

okay bestie, we're in the final stretch of the member functions and it's giving completionist energy ✨ let's close this out πŸ’…

resize β€” the glow-up/glow-down πŸ’‡β€β™€οΈ

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> void
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::resize
    (size_type __n, _CharT __c)

Resizes the string to the specified number of characters. iconic.

Parameters

  • __n β€” number of characters the string should contain.
  • __c β€” character to fill any new elements.

This function will resize the string to the specified number of characters. If the number is smaller than the string's current size the string is truncated, otherwise the string is extended and new elements are set to __c.

Referenced by __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::resize(). (yes, it references itself, main character energy fr fr)

rfind (char) β€” last seen at the function, literally πŸ”

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string< _CharT,
    _Traits, _Alloc, _Base >::size_type __gnu_cxx::__versa_string< _CharT,
    _Traits, _Alloc, _Base >::rfind (_CharT __c, size_type __pos = npos)
    const [noexcept]

Find last position of a character.

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.

rfind (string) β€” bestie, where was the last time you saw this? 🫢

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> size_type
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::rfind
    (const __versa_string< _CharT, _Traits, _Alloc, _Base > & __str,
    size_type __pos = npos) const [inline],  [noexcept]

Find last position of a string.

Parameters

  • __str β€” string to locate.
  • __pos β€” index of character to search back from (default end).

Returns

Index of start of last occurrence.

Starting from __pos, searches backward for value of __str within this string. If found, returns the index where it begins. If not found, returns npos.

References

  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::rfind()

Referenced by

  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_last_of()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::rfind()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::rfind()

rfind (C substring) β€” the "last seen with a length" vibe πŸŽ€

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string< _CharT,
    _Traits, _Alloc, _Base >::size_type __gnu_cxx::__versa_string< _CharT,
    _Traits, _Alloc, _Base >::rfind (const _CharT * __s, size_type __pos,
    size_type __n) const

Find last position of a C substring.

Parameters

  • __s β€” C string to locate.
  • __pos β€” index of character to search back from.
  • __n β€” number of characters from s to search for.

Returns

Index of start of last occurrence.

Starting from __pos, searches backward for the first __n characters in __s within this string. If found, returns the index where it begins. If not found, returns npos.

References

  • std::min()

rfind (C string) β€” no length, just vibes ✨

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> size_type
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::rfind
    (const _CharT * __s, size_type __pos = npos) const [inline]

Find last position of a C string.

Parameters

  • __s β€” C string to locate.
  • __pos β€” index of character to start search at (default end).

Returns

Index of start of last occurrence.

Starting from __pos, searches backward for the value of __s within this string. If found, returns the index where it begins. If not found, returns npos.

References

  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::rfind()

shrink_to_fit β€” the "reduce capacity to size" hint, non-binding bestie πŸ’…

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> void
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base
    >::shrink_to_fit () [inline],  [noexcept]

A non-binding request to reduce capacity() to size().

References

  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::capacity()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::reserve()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size()

size β€” the character count, no nulls invited 🚫

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> size_type
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::size ()
    const [inline],  [noexcept]

Returns the number of characters in the string, not including any null-termination.

Referenced by

  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::append()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::append()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::at()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::at()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::back()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::back()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::cend()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::compare()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::compare()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::empty()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::end()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::end()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_first_not_of()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_first_of()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::find_last_of()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::insert()
  • __gnu_cxx::operator+()
  • __gnu_cxx::operator+()
  • __gnu_cxx::operator+()
  • __gnu_cxx::operator+()
  • __gnu_cxx::operator+()
  • __gnu_cxx::operator==()
  • __gnu_cxx::operator==()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator[]()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator[]()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::pop_back()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::push_back()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::replace()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::shrink_to_fit()

substr β€” get a little slice of the string 🍰

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> __versa_string
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::substr
    (size_type __pos = 0, size_type __n = npos) const [inline]

Get a substring.

Parameters

  • __pos β€” index of first character (default 0).
  • __n β€” number of characters in substring (default remainder).

Returns

The new string.

Exceptions

  • std::out_of_range if pos > size().

Construct and return a new string using the __n characters starting at __pos. If the string is too short, use the remainder of the characters. If __pos is beyond the end of the string, out_of_range is thrown.

swap β€” trade contents in constant time, no cap πŸƒβ€β™€οΈ

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> void
    __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::swap
    (__versa_string< _CharT, _Traits, _Alloc, _Base > & __s) [inline],
    [noexcept]

Swap contents with another string.

Parameters

  • __s β€” string to swap with.

Exchanges the contents of this string with that of __s in constant time.

Referenced by

  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::assign()
  • __gnu_cxx::__versa_string< _CharT, _Traits, _Alloc, _Base >::operator=()
  • __gnu_cxx::swap()

πŸ’– Member Data Documentation πŸ’–

npos β€” the value returned when things fail 😭

template<typename _CharT , typename _Traits , typename _Alloc , template<
    typename, typename, typename > class _Base> const __versa_string<
    _CharT, _Traits, _Alloc, _Base >::size_type __gnu_cxx::__versa_string<
    _CharT, _Traits, _Alloc, _Base >::npos [static]

Value returned by various member functions when they fail.


🌸 Author 🌸

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


And that's the whole page, bestie πŸ’… the footer line is your classic libstd__gnu_cxx::__v..._Alloc, _Base >(3cxx) version/date stamp β€” shoutout to Doxygen for auto-generating this for libstdc++ from the source code, periodt. 🫢✨

πŸ“¦ where this page comes from