std::ranges...op_view::end(3)
π 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
- 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