名稱空間
變體
操作

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

來自 cppreference.com
< cpp‎ | ranges‎ | drop_view
 
 
範圍庫 (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.tw"};
 
    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.com

[編輯] 參閱

返回指向起始的迭代器
(public member function) [編輯]
返回指向範圍開頭的迭代器
(customization point object)[編輯]
返回指示範圍末尾的哨兵
(customization point object)[編輯]