std::basic_const_iterator<Iter>::operator==,<,<=,>,>=,<=> - cppreference.com

From cppreference.com

Equality comparison

template<std::sentinel_for<Iter>S>constexprbooloperator==(constS&s)const; (1)(since C++23)Relational comparisons between two basic_const_iterators

constexprbooloperator<(constbasic_const_iterator&y)constrequiresstd::random_access_iterator<Iter>; (2) (since C++23)constexprbooloperator>(constbasic_const_iterator&y)constrequiresstd::random_access_iterator<Iter>; (3) (since C++23)constexprbooloperator<=(constbasic_const_iterator&y)constrequiresstd::random_access_iterator<Iter>; (4) (since C++23)constexprbooloperator>=(constbasic_const_iterator&y)constrequiresstd::random_access_iterator<Iter>; (5) (since C++23)constexprautooperator<=>(constbasic_const_iterator&y)constrequiresstd::random_access_iterator<Iter>&&std::three_way_comparable<Iter>; (6) (since C++23)Relational comparisons between basic_const_iterator and another type

template</*different-from*/<basic_const_iterator>I>constexprbooloperator<(constI&y)constrequiresstd::random_access_iterator<Iter>&&std::totally_ordered_with<Iter,I>; (7) (since C++23)template</*different-from*/<basic_const_iterator>I>constexprbooloperator>(constI&y)constrequiresstd::random_access_iterator<Iter>&&std::totally_ordered_with<Iter,I>; (8) (since C++23)template</*different-from*/<basic_const_iterator>I>constexprbooloperator<=(constI&y)constrequiresstd::random_access_iterator<Iter>&&std::totally_ordered_with<Iter,I>; (9) (since C++23)template</*different-from*/<basic_const_iterator>I>constexprbooloperator>=(constI&y)constrequiresstd::random_access_iterator<Iter>&&std::totally_ordered_with<Iter,I>; (10) (since C++23)template</*different-from*/<basic_const_iterator>I>constexprautooperator<=>(constI&y)constrequiresstd::random_access_iterator<Iter>&&std::totally_ordered_with<Iter,I>&&std::three_way_comparable_with<Iter,I>; (11) (since C++23)Compares a basic_const_iterator with another value.

The != operator is

synthesized

from operator==.

I satisfies /*different-from*/<basic_const_iterator> if std::same_as<I,basic_const_iterator<Iter>> is false.

Parameters

s - a sentinel for Itery - a value to compare with Return value

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

Notes

Overload (

1

) can be used to compare two basic_const_iterator<Iter> values if Iter models sentinel_for<Iter>.

Example

See also

Categories

:

Pages using deprecated source tags

Pages using deprecated enclose attributes

Todo no example

Todo without reason