std::ranges..._view::begin(3)
π std::ranges::elements_view::begin β no cap, it's giving first element
okay so bestie, welcome to the C++ Standard Libary section of the manual, and today's main character is std::ranges::elements_view::begin. She's the one who gets you to the front of the line π
β¨ SYNOPSIS β¨
constexpr auto begin() requires (!__SimpleView<V>); (1)
(since C++20)
constexpr auto begin() const requires ranges::range<const V>; (2)
(since C++20)
Two overloads, both living their best constexpr life, both here since C++20 π
πΈ DESCRIPTION πΈ
She returns an iterator to the first element of the elements_view. Literally just the glow-up at position zero β¨
Let base_ be the underlying view. Here's how the two overloads shake out:
- Equivalent to
return /*iterator*/<false>(ranges::begin(base_));. π - Equivalent to
return /*iterator*/<true>(ranges::begin(base_));. π
(Yes, overload 1 has that requires (!__SimpleView<V>) gate and overload 2 is the const one with requires ranges::range<const V> β no notes, that's exactly how she's built.)
π¦ PARAMETERS π¦
(none)
Nothing to pass in, she's low-maintenance fr fr π«Ά
π RETURN VALUE π
An iterator to the first element. That's it, that's the whole vibe β
π EXAMPLE π
This section is incomplete Reason: no example
ngl the docs team left this one blank π no example yet, so go off and write your own iconic snippet π
π§ SEE ALSO π§
endβ returns an iterator or a sentinel to the end (public member function) (C++20)ranges::beginβ returns an iterator to the beginning of a range (customization point object) (C++20)
π CATEGORY π
- Todo no example
k that's the whole page, bestie, you ate that πβ¨
source: cppreference.com Β· dated 2024.06.10 Β· std::ranges..._view::begin(3) signing off β mwah π
π¦ 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