Namespaces
Variants

operator- (ranges::adjacent_transform_view:: sentinel )

From cppreference.net
Ranges library
Range adaptors
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 - 哨兵

返回值

迭代器与哨兵之间的距离。

示例