operator==,<,>,<=,>=,<=>(ranges::adjacent_view::iterator)
来自cppreference.com
< cpp | ranges | adjacent view | iterator
范围库
std::ranges::adjacent_view
| 成员函数 | ||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
| 迭代器 | ||||
| 成员函数 | ||||
| 非成员函数 | ||||
|
operator==(adjacent_view::iterator)
operator<(adjacent_view::iterator) operator>(adjacent_view::iterator) operator<=(adjacent_view::iterator) operator>=(adjacent_view::iterator) operator<=>(adjacent_view::iterator) (C++23)(C++23)(C++23)(C++23)(C++23)(C++23)
|
||||
| 哨兵 | ||||
| 成员函数 | ||||
| 非成员函数 | ||||
|
friend
constexpr
bool
operator==(
const
/*iterator*/&
x, const
/*iterator*/&
y );
|
(1) | (C++23 起) |
|
friend
constexpr
bool
operator<(
const
/*iterator*/&
x, const
/*iterator*/&
y )
requires ranges::random_access_range<Base>; |
(2) | (C++23 起) |
|
friend
constexpr
bool
operator>(
const
/*iterator*/&
x, const
/*iterator*/&
y )
requires ranges::random_access_range<Base>; |
(3) | (C++23 起) |
|
friend
constexpr
bool
operator<=(
const
/*iterator*/&
x, const
/*iterator*/&
y )
requires ranges::random_access_range<Base>; |
(4) | (C++23 起) |
|
friend
constexpr
bool
operator>=(
const
/*iterator*/&
x, const
/*iterator*/&
y )
requires ranges::random_access_range<Base>; |
(5) | (C++23 起) |
|
friend
constexpr
auto
operator<=>(
const
/*iterator*/&
x, const
/*iterator*/&
y )
requires ranges::random_access_range<Base>
&& |
(6) | (C++23 起) |
比较底层迭代器,令 current_
为底层迭代器数组。
1) 等价于 return x.current_.back()
== y.current_.back()。
2) 等价于 return x.current_.back()
< y.current_.back()。
3) 等价于 return y < x;。
4) 等价于 return !(y
< x);。
5) 等价于 return !(x
< y);。
6) 等价于 return x.base()
<=> y.base();。
这些函数对通常无限定或有限定查找不可见,而只能在
std::ranges::adjacent_view::iterator<Const>
为参数的关联类时由实参依赖查找找到。
!= 运算符从 == 运算符合成。
参数
| x, y | - | 迭代器 |
返回值
比较的结果。
参阅
|
(C++20)
|
比较哨位与 adjacent_view::begin
返回的迭代器 (函数) |