std::ranges::drop_view<V>::end

From cppreference.com
< cpp‎ | ranges‎ | drop view
 
 
Ranges library
Range access
Range conversions
(哋它亢++23)(哋它亢++23)
(哋它亢++23)

Range primitives
(哋它亢++23)(哋它亢++23)    
(哋它亢++23)



Dangling iterator handling
Range concepts
Views

Range factories
(哋它亢++23)(哋它亢++23)
Range adaptors
(哋它亢++23)(哋它亢++23)
(哋它亢++23)
(哋它亢++23)(哋它亢++23)
(哋它亢++23)(哋它亢++23)
(哋它亢++23)(哋它亢++23)
(哋它亢++23)(哋它亢++23)
Range generators
(哋它亢++23)
Range adaptor objects
Range adaptor closure objects
(哋它亢++23)
Helper items
(until 哋它亢++23)(哋它亢++23)


 
 
constexpr auto end() requires (!__SimpleView<V>);
(1) (since 哋它亢++20)
constexpr auto end() const requires ranges::range<const V>;
(2) (since 哋它亢++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

#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

(哋它亢++20)
returns an iterator to the beginning
(public member function)
(哋它亢++20)
returns an iterator to the beginning of a range
(customization point object)
(哋它亢++20)
returns a sentinel indicating the end of a range
(customization point object)