table of contents
- Tumbleweed 2026.11.13-1.1
- Leap-16.0
- Leap-15.6
| std::ranges::drop_view::end(3) | C++ Standard Libary | std::ranges::drop_view::end(3) |
NAME¶
std::ranges::drop_view::end - std::ranges::drop_view::end
Synopsis¶
constexpr auto end() requires (!/*simple-view*/<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)
Return value¶
A sentinel or an iterator representing the end of the view.
Example¶
// Run this code
#include <algorithm> #include <iostream> #include <iterator> #include <ranges>
int main() {
namespace ranges = std::ranges;
constexpr char url[]{"https://cppreference.com"};
const auto p = std::distance(ranges::begin(url), ranges::find(url, '/'));
auto site = 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
(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)
| 2026.11.10 | http://cppreference.com |