Namespaces
Variants

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

From cppreference.net
Ranges library
Range adaptors
constexpr auto end ( ) requires ( ! /*simple-view*/ < V > ) ;
(1) (C++20 起)
constexpr auto end ( ) const requires ranges:: range < const V > ;
(2) (C++20 起)

返回一个哨兵或迭代器,表示 drop_view 的末尾。

返回值

ranges:: end ( base_ )

示例

#include <algorithm>
#include <iostream>
#include <iterator>
#include <ranges>
int main()
{
    namespace ranges = std::ranges;
    constexpr char url[]{"https://cppreference.net"};
    const auto p = std::distance(ranges::begin(url), ranges::find(url, '/'));
    auto site = ranges::drop_view{url, p + 2}; // 丢弃前缀 "https://"
    for (auto it = site.begin(); it != site.end(); ++it)
        std::cout << *it;
    std::cout << '\n';
}

输出:

cppreference.net

参见

返回指向起始位置的迭代器
(公开成员函数)
返回指向范围起始位置的迭代器
(定制点对象)
返回标识范围结束的哨兵
(定制点对象)