STD::BASIC_STRING_VIEW(3cxx)

πŸ’– NAME

okay so bestie, welcome to the 3cxx manual page for std::basic_string_view< _CharT, _Traits > β€” A non-owning reference to a string. periodt. it's giving β€œlook but don’t touch” energy, and yes the page header up top is a little truncated, but the manual name is 3cxx and we are rolling with it πŸ’….

✨ SYNOPSIS

#include <>>

copy that exactly, bestie β€” even if it looks like it got ate by the group chat 😭.

πŸŽ€ Public Types

  • const_iterator = const value_type * β€” the const iterator is literally a pointer to const value_type.
  • const_pointer = const value_type * β€” same pointer vibe, but now it’s the const pointer type.
  • const_reference = const value_type & β€” a const reference to value_type, iconic.
  • const_reverse_iterator = std::reverse_iterator< const_iterator > β€” reverse iterator wrapped around const_iterator, no cap.
  • difference_type = ptrdiff_t β€” the difference type is ptrdiff_t, periodt.
  • iterator = const_iterator β€” the iterator is just const_iterator, that’s the whole mood.
  • pointer = value_type * β€” pointer type is value_type *.
  • reference = value_type & β€” reference type is value_type &.
  • reverse_iterator = const_reverse_iterator β€” reverse iterator is the const reverse iterator, slay.
  • size_type = size_t β€” size type is size_t, yes bestie.
  • traits_type = _Traits β€” traits type is _Traits.
  • value_type = _CharT β€” value type is _CharT.

🧚 Public Member Functions

this is the whole roster, bestie β€” no skips, no β€œoops I forgot one” behavior πŸ’€.

  • basic_string_view ctor 1 β€” constexpr basic_string_view (const _CharT *__str) noexcept
  • basic_string_view ctor 2 β€” constexpr basic_string_view (const _CharT *__str, size_type __len) noexcept
  • copy ctor β€” constexpr basic_string_view (const basic_string_view &) noexcept=default
  • at β€” constexpr const_reference at (size_type __pos) const
  • back β€” constexpr const_reference back () const noexcept
  • begin β€” constexpr const_iterator begin () const noexcept
  • cbegin β€” constexpr const_iterator cbegin () const noexcept
  • cend β€” constexpr const_iterator cend () const noexcept
  • compare overload 1 β€” constexpr int compare (basic_string_view __str) const noexcept
  • compare overload 2 β€” constexpr int compare (const _CharT *__str) const noexcept
  • compare overload 3 β€” constexpr int compare (size_type __pos1, size_type __n1, basic_string_view __str) const
  • compare overload 4 β€” constexpr int compare (size_type __pos1, size_type __n1, basic_string_view __str, size_type __pos2, size_type __n2) const
  • compare overload 5 β€” constexpr int compare (size_type __pos1, size_type __n1, const _CharT *__str) const
  • compare overload 6 β€” constexpr int compare (size_type __pos1, size_type __n1, const _CharT *__str, size_type __n2) const noexcept(false)
  • copy β€” constexpr size_type copy (_CharT *__str, size_type __n, size_type __pos=0) const
  • crbegin β€” constexpr const_reverse_iterator crbegin () const noexcept
  • crend β€” constexpr const_reverse_iterator crend () const noexcept
  • data β€” constexpr const_pointer data () const noexcept
  • empty β€” constexpr bool empty () const noexcept
  • end β€” constexpr const_iterator end () const noexcept
  • find overload 1 β€” constexpr size_type find (_CharT __c, size_type __pos=0) const noexcept
  • find overload 2 β€” constexpr size_type find (basic_string_view __str, size_type __pos=0) const noexcept
  • find overload 3 β€” constexpr size_type find (const _CharT *__str, size_type __pos, size_type __n) const noexcept
  • find overload 4 β€” constexpr size_type find (const _CharT *__str, size_type __pos=0) const noexcept
  • find_first_not_of overload 1 β€” constexpr size_type find_first_not_of (_CharT __c, size_type __pos=0) const noexcept
  • find_first_not_of overload 2 β€” constexpr size_type find_first_not_of (basic_string_view __str, size_type __pos=0) const noexcept
  • find_first_not_of overload 3 β€” constexpr size_type find_first_not_of (const _CharT *__str, size_type __pos, size_type __n) const noexcept
  • find_first_not_of overload 4 β€” constexpr size_type find_first_not_of (const _CharT *__str, size_type __pos=0) const noexcept
  • find_first_of overload 1 β€” constexpr size_type find_first_of (_CharT __c, size_type __pos=0) const noexcept
  • find_first_of overload 2 β€” constexpr size_type find_first_of (basic_string_view __str, size_type __pos=0) const noexcept
  • find_first_of overload 3 β€” constexpr size_type find_first_of (const _CharT *__str, size_type __pos, size_type __n) const noexcept
  • find_first_of overload 4 β€” constexpr size_type find_first_of (const _CharT *__str, size_type __pos=0) const noexcept
  • find_last_not_of overload 1 β€” constexpr size_type find_last_not_of (_CharT __c, size_type __pos=npos) const noexcept
  • find_last_not_of overload 2 β€” constexpr size_type find_last_not_of (basic_string_view __str, size_type __pos=npos) const noexcept
  • find_last_not_of overload 3 β€” constexpr size_type find_last_not_of (const _CharT *__str, size_type __pos, size_type __n) const noexcept
  • find_last_not_of overload 4 β€” constexpr size_type find_last_not_of (const _CharT *__str, size_type __pos=npos) const noexcept
  • find_last_of overload 1 β€” constexpr size_type find_last_of (_CharT __c, size_type __pos=npos) const noexcept
  • find_last_of overload 2 β€” constexpr size_type find_last_of (basic_string_view __str, size_type __pos=npos) const noexcept
  • find_last_of overload 3 β€” constexpr size_type find_last_of (const _CharT *__str, size_type __pos, size_type __n) const noexcept
  • find_last_of overload 4 β€” constexpr size_type find_last_of (const _CharT *__str, size_type __pos=npos) const noexcept
  • front β€” constexpr const_reference front () const noexcept
  • length β€” constexpr size_type length () const noexcept
  • max_size β€” constexpr size_type max_size () const noexcept
  • assignment operator β€” constexpr basic_string_view & operator= (const basic_string_view &) noexcept=default
  • operator[] β€” constexpr const_reference operator[] (size_type __pos) const noexcept
  • rbegin β€” constexpr const_reverse_iterator rbegin () const noexcept
  • remove_prefix β€” constexpr void remove_prefix (size_type __n) noexcept
  • remove_suffix β€” constexpr void remove_suffix (size_type __n) noexcept
  • rend β€” constexpr const_reverse_iterator rend () const noexcept
  • rfind overload 1 β€” constexpr size_type rfind (_CharT __c, size_type __pos=npos) const noexcept
  • rfind overload 2 β€” constexpr size_type rfind (basic_string_view __str, size_type __pos=npos) const noexcept
  • rfind overload 3 β€” constexpr size_type rfind (const _CharT *__str, size_type __pos, size_type __n) const noexcept
  • rfind overload 4 β€” constexpr size_type rfind (const _CharT *__str, size_type __pos=npos) const noexcept
  • size β€” constexpr size_type size () const noexcept
  • substr β€” constexpr basic_string_view substr (size_type __pos=0, size_type __n=npos) const noexcept(false)
  • swap β€” constexpr void swap (basic_string_view &__sv) noexcept

πŸ“ Static Public Attributes

  • npos β€” static constexpr size_type npos

🌸 Detailed Description

template time, bestie πŸ’–:

   template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
       class std::basic_string_view< _CharT, _Traits >"A non-owning reference
       to a string.

yes, that " right after the > is in the source β€” not me, I promise 😭. we keep every character, always.

πŸ’œ Template Parameters

  • _CharT β€” Type of character
  • _Traits β€” Traits for character type, defaults to char_traits<_CharT>.

A basic_string_view looks like this:

_CharT*    _M_str
size_t     _M_len

that’s the whole internal vibe: _M_str and _M_len, no cap 🫢.

🫢 Author

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

source/version shoutout: libstdc++, generated by Doxygen ✨. the footer energy is libstdstd::basic_str...harT, _Traits >(3cxx), and bestie there is literally no date on the page, so I’m not inventing one β€” love that for us πŸ’–πŸŽ€πŸ¦‹.

πŸ“¦ where this page comes from