std::ranges...op_view::end(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– std::ranges::drop_view::end πŸ’–

okay so this is the NAME section, and the page is from the C++ Standard Libary manual (yes, that's the header's spelling, not me 😭). The name is:

std::ranges::drop_view::end - std::ranges::drop_view::end

That's it. That's the name. Serving duplicate realness exactly like the page did, and honestly? iconic. πŸ’…


🌸 Synopsis 🌸

Two overloads, both since C++20, bestie. Here's the exact signature tea:

constexpr auto end() requires (!__SimpleView<V>);           (1)
(since C++20)
constexpr auto end() const requires ranges::range<const V>; (2)
(since C++20)

Returns a sentinel or an iterator representing the end of the drop_view.

Effectively returns ranges::end(base_), where base_ is the underlying view.

πŸŽ€ Parameters πŸŽ€

(none) β€” literally no parameters, not a single one, periodt.

✨ Return value ✨

A sentinel or an iterator representing the end of the view. That's the return value, no cap.

🧚 Example 🧚

Run this code, bestie β€” here's the example, untouched:

       // Run this code

        #include <algorithm>
        #include <iostream>
        #include <iterator>
        #include <ranges>

        int main()
        {
            constexpr char url[]{"https://cppreference.com"};

            const auto p = std::distance(std::ranges::begin(url),
       std::ranges::find(url, '/'));
            auto site = std::ranges::drop_view{url, p + 2}; // drop the prefix
       "https://"

            for (auto it = site.begin(); it != site.end(); ++it)
                std::cout << *it; //                ^^^
            std::cout << '\n';
        }

πŸ“ Output πŸ“

cppreference.com

πŸ‘‘ See also πŸ‘‘

  • begin β€” returns an iterator to the beginning. (C++20) β€” (public member function)
  • ranges::begin β€” returns an iterator to the beginning of a range. (C++20) β€” (customization point object)
  • ranges::end β€” returns a sentinel indicating the end of a range. (C++20) β€” (customization point object)

okay that's the whole page, mwah 🫢 β€” source/version/date tea: http://cppreference.com, 2024.06.10, and the page tag std::ranges...op_view::end(3). periodt πŸ’…

πŸ“¦ where this page comes from