begin,end(std::basic_string_view) (3) - Linux Manuals

begin,end(std::basic_string_view): begin,end(std::basic_string_view)

NAME

begin,end(std::basic_string_view) - begin,end(std::basic_string_view)

Synopsis


constexpr const_iterator begin(basic_string_view sv) noexcept; (1) (since C++20)
constexpr const_iterator end(basic_string_view sv) noexcept; (2) (since C++20)


1) Returns an iterator to the first character of the view. Equivalent to sv.begin().
2) Returns an iterator to the character following the last character of the view. Equivalent to sv.end().
These functions are not visible to ordinary unqualified or qualified_lookup, and can only be found by argument-dependent_lookup when std::basic_string_view<CharT, Traits> is an associated class of the arguments.

Parameters


sv - a string_view

Return value


1) sv.begin()
2) sv.end()

Notes


These functions are provided to make string_view rvalues work with std::ranges::begin and std::ranges::end, which reject rvalue arguments by default in order to prevent dangling iterator.