std::ranges..._view::begin(3)
π std::ranges..._view::begin(3) π
okay bestie, welcome to the std::ranges::chunk_by_view::begin page from the C++ Standard Libary manual π this is literally the std::ranges..._view::begin(3) one, and yes, we're gonna get through it together π«Ά
π NAME π
std::ranges::chunk_by_view::begin-std::ranges::chunk_by_view::begin
likeβ¦ the name is the name twice, and honestly? iconic π
β¨ Synopsis β¨
constexpr /*iterator*/ begin(); (since C++23)
This returns an iterator to the first element of the chunk_by_view π no cap.
It's equivalent to:
ranges::iterator_t<V> iter;
if (begin_.has_value())
iter = begin_.value();
else
{
iter = /*find_next*/(ranges::begin(base()));
begin_ = iter; // caching
}
return /*iterator*/(*this, ranges::begin(base()), iter);
β οΈ okay so this part is serious: the behavior is undefined if the underlying predicate pred_ does not contain a value. like, undefined is not a vibe, bestie π
π«Ά Parameters π«Ά
(none)β literally none, bestie. nothing. zero. the void πΈ
πΈ Return value πΈ
Iterator to the first element. periodt β¨
π§ Notes π§
In order to provide the amortized constant-time complexity required by the range concept, this function caches the result within the data member begin_ (the name is for exposition only) for use on subsequent calls π«
so yeah, it's giving βremember it so future calls can slayβ π
π Example π
- This section is incomplete
- Reason: no example
not me showing up with no example ππ
π¦ See also π¦
endβ returns an iterator or a sentinel to the end (C++23) (public member function)ranges::beginβ returns an iterator to the beginning of a range (C++20) (customization point object)
π Category π
Todo no example
source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::ranges..._view::begin(3) β mwah, that's the whole manual page, 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