命名空间
变体
操作

operator-(ranges::adjacent_transform_view::sentinel)

来自 cppreference.cn
 
 
范围库
范围适配器
 
 
template< bool OtherConst >

    requires std::sized_sentinel_for</*inner-sentinel*/<Const>,
                                     /*inner-iterator*/<OtherConst>>
friend constexpr
    ranges::range_difference_t</*maybe-const*/<OtherConst, InnerView>>

        operator-( const /*iterator*/<OtherConst>& x, const /*sentinel*/& y );
(1) (自 C++23 起)
template< bool OtherConst >

    requires std::sized_sentinel_for</*inner-sentinel*/<Const>,
                                     /*inner-iterator*/<OtherConst>>
friend constexpr
    ranges::range_difference_t</*maybe-const*/<OtherConst, InnerView>>

        operator-( const /*sentinel*/& y, const /*iterator*/<OtherConst>& x );
(2) (自 C++23 起)

计算迭代器 x哨位 y 之间的距离。

1) 等价于: return x.inner_ - y.inner_;
2) 等价于: return y.inner_ - x.inner_;

这些函数模板对于普通的非限定查找限定查找是不可见的,并且只能通过实参依赖查找adjacent_transform_view::sentinel 是参数的关联类时找到。

[编辑] 参数

x - 迭代器
y - 哨位

[编辑] 返回值

迭代器和哨位之间的距离。

[编辑] 示例