Namespaces
Variants

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

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)
template < /*not-a-const-iterator*/ I >

friend constexpr bool operator < ( const I & x, const basic_const_iterator & y )

erfordert std:: random_access_iterator < Iter > && std:: totally_ordered_with < Iter, I > ;
(1) (seit C++23)
template < /*not-a-const-iterator*/ I >

friend constexpr bool operator > ( const I & x, const basic_const_iterator & y )

erfordert std:: random_access_iterator < Iter > && std:: totally_ordered_with < Iter, I > ;
(2) (seit C++23)
template < /*not-a-const-iterator*/ I >

friend constexpr bool operator <= ( const I & x, const basic_const_iterator & y )

erfordert std:: random_access_iterator < Iter > && std:: totally_ordered_with < Iter, I > ;
(3) (seit C++23)
template < /*not-a-const-iterator*/ I >

friend constexpr bool operator >= ( const I & x, const basic_const_iterator & y )

erfordert std:: random_access_iterator < Iter > && std:: totally_ordered_with < Iter, I > ;
(4) (seit C++23)

Vergleiche einen basic_const_iterator mit einem anderen Wert. Diese Funktionsvorlagen werden verwendet, wenn der linke Operand kein basic_const_iterator ist.

I erfüllt das ausschließlich der Darstellung dienende Konzept /*not-a-const-iterator*/ genau dann, wenn es keine Spezialisierung von basic_const_iterator ist.

Diese Funktionen sind für gewöhnliche unqualified oder qualified lookup nicht sichtbar und können nur durch argument-dependent lookup gefunden werden, wenn basic_const_iterator < Iter > eine assoziierte Klasse der Argumente ist.

Inhaltsverzeichnis

Parameter

x, y - zu vergleichende Iteratoren

Rückgabewert

1) x < y. base ( )
2) x > y. base ( )
3) x <= y. base ( )
4) x >= y. base ( )

Hinweise

Wenn der linke Operand ein basic_const_iterator ist, werden die Mitgliedervergleichsfunktionen verwendet.

Beispiel

#include <iterator>
int main()
{
    static int arr[1];
    static constexpr std::basic_const_iterator<int*> it = std::end(arr);
    static_assert(arr < it);
}

Siehe auch