命名空间
变体
操作

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

来自 cppreference.cn
< cpp‎ | ranges‎ | drop view
 
 
范围库
范围适配器
 
 
constexpr auto end() requires (!/*simple-view*/<V>);
(1) (since C++20)
constexpr auto end() const requires ranges::range<const V>;
(2) (since 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.cn"};
 
    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';
}

输出

cppreference.cn

[编辑] 参见

返回指向开头的迭代器
(公共成员函数) [编辑]
返回指向范围开头的迭代器
(定制点对象)[编辑]
返回一个哨位,指示范围的末尾
(定制点对象)[编辑]