constexpr iterator begin(span s) noexcept; | (1) | (since C++20) |
constexpr iterator end(span s) noexcept; | (2) | (since C++20) |
s.begin()
.s.end()
.These functions are not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when std::span<T, Extent>
is an associated class of the arguments.
s | - | a span |
s.begin()
s.end()
These functions are provided to make span
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/container/span/begin_end_nonmem