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) |
sv.begin()
.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.
sv | - | a string_view |
sv.begin()
sv.end()
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