std::ranges..._view::begin(3)
π std::ranges::join_view::begin π
Header says std::ranges..._view::begin(3), from the C++ Standard Libary manual β yes, that's the header spelling, and I'm keeping it, bestie. This page is giving overload energy, and we're gonna read every crumb. β¨
β¨ NAME β¨
std::ranges::join_view::begin β like, the actual begin member of std::ranges::join_view. No cap.
πΈ Synopsis πΈ
constexpr auto begin();
(1) (since C++20)
constexpr auto begin() const
requires ranges::input_range<const V> &&
std::is_reference_v<ranges::range_reference_t<const V>>;
(2) (since C++20)
Returns an iterator to the first element of the join_view. Given base_ is the underlying view:
- Equivalent to
return /*iterator*/<true>{*this, ranges::begin(base_)};if__SimpleView<V>is satisfied andranges::range_reference_t<V>is reference type. Otherwise, equivalent toreturn /*iterator*/<false>{*this, ranges::begin(base_)};. - Equivalent to
return /*iterator*/<true>{*this, ranges::begin(base_)};.
π Parameters π
(none) β literally none, not a single argument. Slay.
π Return value π
An iterator to the first element. Periodt.
π§ Notes π§
Here's the important tea: when ranges::range_reference_t<V> is not a reference type β that is, when deferencing an iterator of V returns a prvalue temporary β the join_view is only an input_range. In that case only single-pass iteration is supported, and repeated calls to begin() may not give meaningful results.
β οΈ so yeah, if that reference-type condition isn't met, don't expect repeated begin() calls to be cute and stable. Single-pass only, bestie. π
π Example π
This section is incomplete. Reason: no example.
π the page really says "This section is incomplete" and "Reason: no example". That's the whole example section. Iconic in a tragic way.
π See also π
endβ returns an iterator or a sentinel to the end (C++20) (public member function)ranges::beginβ returns an iterator to the beginning of a range (C++20) (customization point object)
π¦ Category π¦
- * Todo no example
Source/version/date check: http://cppreference.com, 2024.06.10, filed under std::ranges..._view::begin(3) β mwah π, that's the sign-off, bestie. π«Ά
π¦ 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