Namensräume
Varianten
Aktionen

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

Von cppreference.com
 
 
Iterator-Bibliothek
Iterator-Konzepte
Iterator-Primitive
Algorithmus-Konzepte und Hilfsprogramme
Indirekte aufrufbare Konzepte
Gemeinsame Algorithmus-Anforderungen
(C++20)
(C++20)
(C++20)
Dienstprogramme
(C++20)
Iterator-Adapter
Bereichszugriff
(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 )

    requires 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 )

    requires 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 )

    requires 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 )

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

Vergleicht ein basic_const_iterator mit einem anderen Wert. Diese Funktion-Templates werden verwendet, wenn der linke Operand kein basic_const_iterator ist.

I erfüllt das Exposition-only-Konzept /*not-a-const-iterator*/ genau dann, wenn es keine Spezialisierung von basic_const_iterator ist.

Diese Funktionen sind für die normale unqualifizierte oder qualifizierte Suche nicht sichtbar und können nur durch die argumentabhängige Suche gefunden werden, wenn basic_const_iterator<Iter> eine assoziierte Klasse der Argumente ist.

Inhalt

[bearbeiten] Parameter

x, y - zu vergleichende Iteratoren

[bearbeiten] Rückgabewert

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

[bearbeiten] Hinweise

Wenn der linke Operand ein basic_const_iterator ist, werden die Member-Vergleichsfunktionen verwendet.

[bearbeiten] Beispiel

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

[bearbeiten] Siehe auch