std::ranges::drop_view<V>::end
来自cppreference.com
| |
(1) | (C++20 起) |
| |
(2) | (C++20 起) |
返回表示 drop_view 末尾的迭代器或哨位。
返回值
ranges::end(base_)。
示例
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}; // 丢弃前缀 "https://"
for (auto it = site.begin(); it != site.end(); ++it)
std::cout << *it;
std::cout << '\n';
}
输出:
cppreference.com
参阅
| 返回指向起始的迭代器 (公开成员函数) | |
(C++20) |
返回指向范围起始的迭代器 (定制点对象) |
(C++20) |
返回指示范围结尾的哨位 (定制点对象) |