std::ranges::split_view<V,Pattern>::end

来自cppreference.com
 
 
范围库
范围适配器
 
 
<tbody> </tbody>
constexpr auto end() const;
(C++20 起)

返回表示结果子范围末尾的迭代器哨位。等价于:

constexpr auto end() { if constexpr (ranges::common_range<V>) return iterator{*this, ranges::end(base_), {}}; else return sentinel{*this}; }

返回值

一个迭代器哨位

示例

#include <cassert>
#include <ranges>
#include <string_view>

int main()
{
    constexpr std::string_view keywords{"bitand bitor bool break"};
    std::ranges::split_view kw{keywords, ' '};
    assert(4 == std::ranges::distance(kw.begin(), kw.end()));
}

参阅

返回指向起始的迭代器
(公开成员函数) [编辑]
返回 指向末尾的迭代器或哨位
(std::ranges::lazy_split_view<V,Pattern> 的公开成员函数) [编辑]
返回指示范围结尾的哨位
(定制点对象) [编辑]