std::basic_const_iterator<Iter>::operator==,<,<=,>,>=,<=>
来自 cppreference.cn
< cpp | 迭代器 | basic_const_iterator
相等比较 |
||
template< std::sentinel_for<Iter> S > constexpr bool operator==( const S& s ) const; |
(1) | (C++23 起) |
两个 basic_const_iterator 之间的关系比较 |
||
constexpr bool operator<( const basic_const_iterator& y ) const requires std::random_access_iterator<Iter>; |
(2) | (C++23 起) |
constexpr bool operator>( const basic_const_iterator& y ) const requires std::random_access_iterator<Iter>; |
(3) | (C++23 起) |
constexpr bool operator<=( const basic_const_iterator& y ) const requires std::random_access_iterator<Iter>; |
(4) | (C++23 起) |
constexpr bool operator>=( const basic_const_iterator& y ) const requires std::random_access_iterator<Iter>; |
(5) | (C++23 起) |
constexpr auto operator<=>( const basic_const_iterator& y ) const requires std::random_access_iterator<Iter> && std::three_way_comparable<Iter>; |
(6) | (C++23 起) |
basic_const_iterator 与其他类型之间的关系比较 |
||
template< /*不同于*/<basic_const_iterator> I > constexpr bool operator<( const I& y ) const |
(7) | (C++23 起) |
template< /*不同于*/<basic_const_iterator> I > constexpr bool operator>( const I& y ) const |
(8) | (C++23 起) |
template< /*不同于*/<basic_const_iterator> I > constexpr bool operator<=( const I& y ) const |
(9) | (C++23 起) |
template< /*不同于*/<basic_const_iterator> I > constexpr bool operator>=( const I& y ) const |
(10) | (C++23 起) |
template< /*不同于*/<basic_const_iterator> I > constexpr auto operator<=>( const I& y ) const |
(11) | (C++23 起) |
将basic_const_iterator
与另一个值进行比较。
!=
运算符由 operator==
合成。
I满足/*不同于*/<basic_const_iterator>,如果std::same_as<I, basic_const_iterator<Iter>>为假。
目录 |
[编辑] 参数
s | - | Iter 的哨兵 |
y | - | 要比较的值 |
[编辑] 返回值
1) base() == s
2) base() < y.base()
3) base() > y.base()
4) base() <= y.base()
5) base() >= y.base()
6) base() <=> y.base()
7) base() < y
8) base() > y
9) base() <= y
10) base() >= y
11) base() <=> y
[编辑] 注意
重载(1)可用于比较两个basic_const_iterator<Iter>
值,如果Iter
模型为sentinel_for<Iter>。
[编辑] 示例
本节不完整 原因:无示例 |
[编辑] 另请参阅
|