Namespaces
Variants

operator- (std::move_iterator<Iter>, std::move_sentinel)

From cppreference.net
Iterator library
Iterator concepts
Iterator primitives
Algorithm concepts and utilities
Indirect callable concepts
Common algorithm requirements
(C++20)
(C++20)
(C++20)
Utilities
(C++20)
Iterator adaptors
Range access
(C++11) (C++14)
(C++14) (C++14)
(C++11) (C++14)
(C++14) (C++14)
(C++17) (C++20)
(C++17)
(C++17)
template < std:: sized_sentinel_for < Iter > S >

friend constexpr std:: iter_difference_t < Iter >

operator - ( const std:: move_sentinel < S > & s, const move_iterator & i ) ;
(1) (C++20 起)
template < std:: sized_sentinel_for < Iter > S >

friend constexpr std:: iter_difference_t < Iter >

operator - ( const move_iterator & i, const std:: move_sentinel < S > & s ) ;
(2) (C++20 起)

返回 move_iterator move_sentinel 之间的距离。

这些函数模板对普通的 非限定查找 限定查找 不可见,仅当 std:: move_iterator < Iter > 作为参数的关联类时,才能通过 实参依赖查找 被发现。

目录

参数

i - std:: move_iterator < Iter >
s - std:: move_sentinel < S > ,其中 S 需满足 std:: sized_sentinel_for < Iter > 概念

返回值

1) s. base ( ) - i. base ( )
2) i. base ( ) - s. base ( )

示例

参见

(C++11)
计算两个迭代器适配器之间的距离
(函数模板)