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 toconst 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 tovalue_type, iconic.const_reverse_iterator=std::reverse_iterator< const_iterator >β reverse iterator wrapped aroundconst_iterator, no cap.difference_type=ptrdiff_tβ the difference type isptrdiff_t, periodt.iterator=const_iteratorβ the iterator is justconst_iterator, thatβs the whole mood.pointer=value_type *β pointer type isvalue_type *.reference=value_type &β reference type isvalue_type &.reverse_iterator=const_reverse_iteratorβ reverse iterator is the const reverse iterator, slay.size_type=size_tβ size type issize_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_viewctor 1 βconstexpr basic_string_view (const _CharT *__str) noexceptbasic_string_viewctor 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) constbackβconstexpr const_reference back () const noexceptbeginβconstexpr const_iterator begin () const noexceptcbeginβconstexpr const_iterator cbegin () const noexceptcendβconstexpr const_iterator cend () const noexceptcompareoverload 1 βconstexpr int compare (basic_string_view __str) const noexceptcompareoverload 2 βconstexpr int compare (const _CharT *__str) const noexceptcompareoverload 3 βconstexpr int compare (size_type __pos1, size_type __n1, basic_string_view __str) constcompareoverload 4 βconstexpr int compare (size_type __pos1, size_type __n1, basic_string_view __str, size_type __pos2, size_type __n2) constcompareoverload 5 βconstexpr int compare (size_type __pos1, size_type __n1, const _CharT *__str) constcompareoverload 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) constcrbeginβconstexpr const_reverse_iterator crbegin () const noexceptcrendβconstexpr const_reverse_iterator crend () const noexceptdataβconstexpr const_pointer data () const noexceptemptyβconstexpr bool empty () const noexceptendβconstexpr const_iterator end () const noexceptfindoverload 1 βconstexpr size_type find (_CharT __c, size_type __pos=0) const noexceptfindoverload 2 βconstexpr size_type find (basic_string_view __str, size_type __pos=0) const noexceptfindoverload 3 βconstexpr size_type find (const _CharT *__str, size_type __pos, size_type __n) const noexceptfindoverload 4 βconstexpr size_type find (const _CharT *__str, size_type __pos=0) const noexceptfind_first_not_ofoverload 1 βconstexpr size_type find_first_not_of (_CharT __c, size_type __pos=0) const noexceptfind_first_not_ofoverload 2 βconstexpr size_type find_first_not_of (basic_string_view __str, size_type __pos=0) const noexceptfind_first_not_ofoverload 3 βconstexpr size_type find_first_not_of (const _CharT *__str, size_type __pos, size_type __n) const noexceptfind_first_not_ofoverload 4 βconstexpr size_type find_first_not_of (const _CharT *__str, size_type __pos=0) const noexceptfind_first_ofoverload 1 βconstexpr size_type find_first_of (_CharT __c, size_type __pos=0) const noexceptfind_first_ofoverload 2 βconstexpr size_type find_first_of (basic_string_view __str, size_type __pos=0) const noexceptfind_first_ofoverload 3 βconstexpr size_type find_first_of (const _CharT *__str, size_type __pos, size_type __n) const noexceptfind_first_ofoverload 4 βconstexpr size_type find_first_of (const _CharT *__str, size_type __pos=0) const noexceptfind_last_not_ofoverload 1 βconstexpr size_type find_last_not_of (_CharT __c, size_type __pos=npos) const noexceptfind_last_not_ofoverload 2 βconstexpr size_type find_last_not_of (basic_string_view __str, size_type __pos=npos) const noexceptfind_last_not_ofoverload 3 βconstexpr size_type find_last_not_of (const _CharT *__str, size_type __pos, size_type __n) const noexceptfind_last_not_ofoverload 4 βconstexpr size_type find_last_not_of (const _CharT *__str, size_type __pos=npos) const noexceptfind_last_ofoverload 1 βconstexpr size_type find_last_of (_CharT __c, size_type __pos=npos) const noexceptfind_last_ofoverload 2 βconstexpr size_type find_last_of (basic_string_view __str, size_type __pos=npos) const noexceptfind_last_ofoverload 3 βconstexpr size_type find_last_of (const _CharT *__str, size_type __pos, size_type __n) const noexceptfind_last_ofoverload 4 βconstexpr size_type find_last_of (const _CharT *__str, size_type __pos=npos) const noexceptfrontβconstexpr const_reference front () const noexceptlengthβconstexpr size_type length () const noexceptmax_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 noexceptrbeginβconstexpr const_reverse_iterator rbegin () const noexceptremove_prefixβconstexpr void remove_prefix (size_type __n) noexceptremove_suffixβconstexpr void remove_suffix (size_type __n) noexceptrendβconstexpr const_reverse_iterator rend () const noexceptrfindoverload 1 βconstexpr size_type rfind (_CharT __c, size_type __pos=npos) const noexceptrfindoverload 2 βconstexpr size_type rfind (basic_string_view __str, size_type __pos=npos) const noexceptrfindoverload 3 βconstexpr size_type rfind (const _CharT *__str, size_type __pos, size_type __n) const noexceptrfindoverload 4 βconstexpr size_type rfind (const _CharT *__str, size_type __pos=npos) const noexceptsizeβconstexpr size_type size () const noexceptsubstrβ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 tochar_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
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms