std::ranges...ts_view::end(3)
β¨ std::ranges...ts_view::end(3) β¨
hey bestie!! this is from the C++ Standard Libary manual β section 3, and the page is literally std::ranges...ts_view::end(3). it's C++20, it's ranges, and it's lowkey about how elements_view tells you where the end is π«Ά
πΈ NAME πΈ
std::ranges::elements_view::end - std::ranges::elements_view::end
π¦ Synopsis π¦
okay so there are four overloads, and they're giving βwhich end do you wantβ energy. all of these are (since C++20):
constexpr auto end() requires (!__SimpleView<V> &&
!ranges::common_range<V>); // (1) (since C++20)
constexpr auto end() requires (!__SimpleView<V> &&
ranges::common_range<V>); // (2) (since C++20)
constexpr auto end() const requires ranges::range<const V>;
// (3) (since C++20)
constexpr auto end() const requires ranges::common_range<const V>;
// (4) (since C++20)
Returns a sentinel or an iterator representing the end of the elements_view.
Let base_ be the underlying view:
- Equivalent to
return /*sentinel*/<false>{ranges::end(base_)};. - Equivalent to
return /*iterator*/<false>{ranges::end(base_)};. - Equivalent to
return /*sentinel*/<true>{ranges::end(base_)};. - Equivalent to
return /*iterator*/<true>{ranges::end(base_)};.
π Parameters π
(none) β literally no parameters, not a single one, she's self-sufficient π
π Return value π
1,3)sentinelwhich compares equal to the end iterator2,4)iteratorto the element following the last element
π Notes π
end() returns an iterator if and only if the underlying view is a common_range:
elements_view<V,F> models common_range whenever V does.
π Example π
This section is incomplete
Reason: no example
π See also π
beginβ returns an iterator to the beginning(C++20)(public member function)ranges::endβ returns a sentinel indicating the end of a range(C++20)(customization point object)
π·οΈ Category π·οΈ
* Todo no example
mwah π this page came from http://cppreference.com, dated 2024.06.10, and it's literally std::ranges...ts_view::end(3). bye bestie, slay your ranges!! π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms