W3cubDocs

/C++

begin,end(std::basic_string_view)

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.

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/string/basic_string_view/begin_end_nonmem