std::ranges...::find_next(3)
πΈ NAME πΈ
okay so bestie, this page is from the C++ Standard Libary manual (yes, that's literally the spelling in the header β we are not fixing it, it's iconic π
). The NAME section is giving repetitive main character energy:
std::ranges::split_view::find_nextβstd::ranges::split_view::find_next(fr fr, the manpage says it twice and we're keeping both).
β¨ Synopsis β¨
Here's the signature, copied exactly (the (exposition only*) note is doing a lot of heavy lifting):
constexpr ranges::subrange<ranges::iterator_t<V>> (exposition only*)
/*find_next*/( ranges::iterator_t<V> it );
So what does it do? It searches for the next occurrence of pattern in the underlying view πβ¨.
bestie, important warning: this function is for exposition only and its name is not normative β iykyk, it's an explainer thing, not the real API name. π
It's equivalent to this exact code:
auto [b, e] = ranges::search(ranges::subrange(it, ranges::end(base_)),
pattern_);
if (b != ranges::end(base_) and ranges::empty(pattern_))
{
++b;
++e;
}
return {b, e};
π Parameters π
itβ an iterator to the position at which to start the search. That's it, that's the whole parameter list, slay.
π Return value π
A subrange that represents the next position of the pattern, if it was found. An empty subrange otherwise. So if it finds the pattern? You get the next spot. If not? Empty subrange, bye. π
and that's the vibe check, bestie! source/version shoutout: this came from http://cppreference.com, version 2024.06.10, and the footer is still out here saying std::ranges...::find_next(3) β iconic. byeee π«Άβ¨π
π¦ 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