operator<,<=,>,>= (std::basic_const_iterator<Iter>)
| Iterator concepts | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Iterator primitives | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Algorithm concepts and utilities | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Indirect callable concepts | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Common algorithm requirements | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Utilities | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Iterator adaptors | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
| Non-member functions | ||||
|
operator<
operator<=
operator>
operator>=
(C++23)
(C++23)
(C++23)
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
| Helper classes | ||||
|
template
<
/*非常量迭代器*/
I
>
friend
constexpr
bool
operator
<
(
const
I
&
x,
const
basic_const_iterator
&
y
)
|
(1) | (自 C++23 起) |
|
template
<
/*非常量迭代器*/
I
>
friend
constexpr
bool
operator
>
(
const
I
&
x,
const
basic_const_iterator
&
y
)
|
(2) | (自 C++23 起) |
|
template
<
/*非常量迭代器*/
I
>
friend
constexpr
bool
operator
<=
(
const
I
&
x,
const
basic_const_iterator
&
y
)
|
(3) | (自 C++23 起) |
|
template
<
/*非常量迭代器*/
I
>
friend
constexpr
bool
operator
>=
(
const
I
&
x,
const
basic_const_iterator
&
y
)
|
(4) | (自 C++23 起) |
将
basic_const_iterator
与其他值进行比较。当左操作数不是
basic_const_iterator
时使用这些函数模板。
I
满足仅用于说明的概念
/*not-a-const-iterator*/
当且仅当它不是
basic_const_iterator
的特化。
这些函数对普通的 非限定查找 或 限定查找 不可见,仅当 basic_const_iterator < Iter > 作为参数的关联类时,才能通过 实参依赖查找 找到。
目录 |
参数
| x, y | - | 待比较的迭代器 |
返回值
注释
如果左操作数是
basic_const_iterator
,则使用
成员比较函数
。
示例
#include <iterator> int main() { static int arr[1]; static constexpr std::basic_const_iterator<int*> it = std::end(arr); static_assert(arr < it); }
参见
|
|||