operator-(ranges::transform_view::sentinel)

来自cppreference.com


 
 
范围库
范围适配器
 
 
friend constexpr ranges::range_difference_t<Base>

    operator-( const /*iterator*/<Const>& x, const /*sentinel*/& y )
        requires std::sized_sentinel_for<ranges::sentinel_t<Base>,

                                         ranges::iterator_t<Base>>;
(1)(C++20 起)
friend constexpr ranges::range_difference_t<Base>

    operator-( const /*sentinel*/& y, const /*iterator*/<Const>& x )
        requires std::sized_sentinel_for<ranges::sentinel_t<Base>,

                                         ranges::iterator_t<Base>>;
(2)(C++20 起)

计算 x 的底层迭代器与 y 的底层哨位间的距离。

这些函数对常规的无限定有限定查找不可见,而只能在 transform_view::sentinel<Const> 为实参的关联类时由实参依赖查找找到。

参数

x-迭代器
y-哨位

返回值

current_ 代表底层迭代器,end_ 代表底层哨位。

1)x.current_ == y.end_
2)y.end_ == x.current_