Namespaces
Variants

std::basic_const_iterator<Iter>:: operator==,<,<=,>,>=,<=>

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)
(Примечание: В данном фрагменте HTML отсутствует текстовое содержимое для перевода - присутствуют только HTML-теги и атрибуты, которые согласно инструкциям не подлежат переводу)
Сравнение на равенство
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
требует std:: random_access_iterator < Iter > && std:: three_way_comparable < Iter > ;
(6) (начиная с C++23)
Реляционные сравнения между basic_const_iterator и другим типом
template < /*different-from*/ < basic_const_iterator > I >

constexpr bool operator < ( const I & y ) const

requires std:: random_access_iterator < Iter > && std:: totally_ordered_with < Iter, I > ;
(7) (начиная с C++23)
template < /*different-from*/ < basic_const_iterator > I >

constexpr bool operator > ( const I & y ) const

requires std:: random_access_iterator < Iter > && std:: totally_ordered_with < Iter, I > ;
(8) (начиная с C++23)
template < /*different-from*/ < basic_const_iterator > I >

constexpr bool operator <= ( const I & y ) const

requires std:: random_access_iterator < Iter > && std:: totally_ordered_with < Iter, I > ;
(9) (начиная с C++23)
template < /*different-from*/ < basic_const_iterator > I >

constexpr bool operator >= ( const I & y ) const

requires std:: random_access_iterator < Iter > && std:: totally_ordered_with < Iter, I > ;
(10) (начиная с C++23)
template < /*different-from*/ < basic_const_iterator > I >

constexpr auto operator <=> ( const I & y ) const
требует std:: random_access_iterator < Iter > &&
std:: totally_ordered_with < Iter, I > &&

std:: three_way_comparable_with < Iter, I > ;
(11) (начиная с C++23)

Сравнивает basic_const_iterator с другим значением.

Оператор != синтезируется из operator== .

I удовлетворяет /*different-from*/ < 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 > .

Пример

Смотрите также