std::experi..._view::rfind(3)
π NAME π
std::experimental::basic_string_view::rfind β and yeah, that's the name twice, because the page says it twice: std::experimental::basic_string_view::rfind. Bestie, this one lives in the C++ Standard Libary man pages and it's a (library fundamentals TS) situation the whole way through π§β¨
β¨ Synopsis β¨
constexpr size_type rfind(basic_string_view v, size_type pos = npos) const noexcept; (1) (library fundamentals TS)
constexpr size_type rfind(CharT c, size_type pos = npos) const noexcept; (2) (library fundamentals TS)
constexpr size_type rfind(const CharT* s, size_type pos, size_type count) const; (3) (library fundamentals TS)
constexpr size_type rfind(const CharT* s, size_type pos = npos) const; (4) (library fundamentals TS)
okay so the whole point: she finds the last substring equal to the character sequence you give her. it's giving "I'll find it, but I'm starting from the back, main character energy" π
- Finds the last occurrence of v in this view, starting at position pos.
- Equivalent to
rfind(basic_string_view(&c, 1), pos). - Equivalent to
rfind(basic_string_view(s, count), pos). - Equivalent to
rfind(basic_string_view(s), pos).
quick observation bestie: overloads (1) and (2) are the ones with const noexcept, and (3) and (4) in the synopsis do not have it. not me pointing it out, just saying π
π Parameters π
vβ the view you're searching for π«Άposβ the position at which to start the searchcountβ length of the substring to search forsβ pointer to a character string to search forchβ character to search for (the parameter list saysch, overload (2) up top saysc, both are iconic, we hold space for both π)
πΈ Return value πΈ
Position of the first character of the found substring, or npos if no such substring is found. npos is literally the "she's not here, babe" of return values π
π¦ Complexity π¦
O(size() * v.size()) at worst. so worst case she's doing the absolute most, no cap π₯
π See also π
findβ find characters in the view (public member function)find_first_ofβ find first occurrence of characters (public member function)find_last_ofβ find last occurrence of characters (public member function)find_first_not_ofβ find first absence of characters (public member function)find_last_not_ofβ find last absence of characters (public member function)
β Category β
* Noindexed pages
okay that's the page, periodt π this gorgeous thing came from http://cppreference.com, version 2024.06.10, and yes the whole manpage is titled std::experi..._view::rfind(3) β mwah, go search something backwards 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