operator==,!=,<,<=,>,>=,<=> (std::sub_match)
|
Definiert in Header
<regex>
|
||
|
Direkter Vergleich
|
||
|
template
<
class
BidirIt
>
bool
operator
==
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(1) | (seit C++11) |
|
template
<
class
BidirIt
>
bool
operator
!
=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(2) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
<
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(3) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
<=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(4) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(5) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
>=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(6) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
auto
operator
<=>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(7) | (seit C++20) |
|
Vergleich mit einem
std::basic_string
|
||
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
==
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(8) | (seit C++11) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
!
=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(9) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
<
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(10) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
<=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(11) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(12) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
>=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(13) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
auto
operator
<=>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(14) | (seit C++20) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
==
(
const
std::
basic_string
<
/*value-type-of*/
<
BidirIt
>
,
|
(15) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
!
=
(
const
std::
basic_string
<
/*value-type-of*/
<
BidirIt
>
,
|
(16) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
<
(
const
std::
basic_string
<
/*value-type-of*/
<
BidirIt
>
,
|
(17) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
<=
(
const
std::
basic_string
<
/*value-type-of*/
<
BidirIt
>
,
|
(18) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
>
(
const
std::
basic_string
<
/*value-type-of*/
<
BidirIt
>
,
|
(19) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
>=
(
const
std::
basic_string
<
/*Werttyp-von*/
<
BidirIt
>
,
|
(20) |
(seit C++11)
(bis C++20) |
|
Vergleich mit einem C-String
|
||
|
template
<
class
BidirIt
>
bool
operator
==
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(21) | (seit C++11) |
|
template
<
class
BidirIt
>
bool
operator
!
=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(22) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
<
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(23) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
<=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(24) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(25) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
>=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(26) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
auto
operator
<=>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(27) | (seit C++20) |
|
template
<
class
BidirIt
>
bool
operator
==
(
const
/*value-type-of*/
<
BidirIt
>
*
s,
|
(28) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
!
=
(
const
/*value-type-of*/
<
BidirIt
>
*
s,
|
(29) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
<
(
const
/*value-type-of*/
<
BidirIt
>
*
s,
|
(30) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
<=
(
const
/*value-type-of*/
<
BidirIt
>
*
s,
|
(31) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
>
(
const
/*value-type-of*/
<
BidirIt
>
*
s,
|
(32) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
>=
(
const
/*value-type-of*/
<
BidirIt
>
*
s,
|
(33) |
(seit C++11)
(bis C++20) |
|
Vergleich mit einem einzelnen Zeichen
|
||
|
template
<
class
BidirIt
>
bool
operator
==
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(34) | (seit C++11) |
|
template
<
class
BidirIt
>
bool
operator
!
=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(35) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
<
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(36) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
<=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(37) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(38) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
>=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(39) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
auto
operator
<=>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(40) | (seit C++20) |
|
template
<
class
BidirIt
>
bool
operator
==
(
const
/*value-type-of*/
<
BidirIt
>
&
ch,
|
(41) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
!
=
(
const
/*value-type-of*/
<
BidirIt
>
&
ch,
|
(42) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
<
(
const
/*value-type-of*/
<
BidirIt
>
&
ch,
|
(43) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
<=
(
const
/*value-type-of*/
<
BidirIt
>
&
ch,
|
(44) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
>
(
const
/*value-type-of*/
<
BidirIt
>
&
ch,
|
(45) |
(seit C++11)
(bis C++20) |
|
template
<
class
BidirIt
>
bool
operator
>=
(
const
/*value-type-of*/
<
BidirIt
>
&
ch,
|
(46) |
(seit C++11)
(bis C++20) |
|
Hilfstyp-Aliase
|
||
|
template
<
class
BidirIt
>
using
/*value-type-of*/
=
|
(47) | ( nur zur Darstellung* ) |
|
template
<
class
BidirIt
>
using
/*cat-type-of*/
=
|
(48) |
(seit C++20)
( Nur zur Darstellung* ) |
Vergleicht einen
sub_match
mit einem anderen
sub_match
, einem
std::string
, einem C-String oder einem einzelnen Zeichen.
sub_match
direkt.
sub_match
mit einem C-String.
sub_match
mit einem einzelnen Zeichen.
|
Die Operatoren
|
(seit C++20) |
cat-type-of
<
BidirIt
>
ist der Ergebnistyp des Drei-Wege-Vergleichs von
std::
sub_match
<
BidirIt
>
.
Inhaltsverzeichnis |
Parameter
| lhs, rhs | - |
ein
sub_match
zum Vergleichen
|
| str | - | eine std::basic_string zum Vergleichen |
| s | - | ein Zeiger auf einen C-String zum Vergleichen |
| ch | - | ein Zeichen zum Vergleichen |
Rückgabewert
Sei target die folgenden Werte:
Die Rückgabewerte sind wie folgt definiert:
| Operator | Rückgabewert | |
|---|---|---|
|
Überladungen
(1-14,21-27,34-40)
(Überladungen mit Parameter lhs ) |
Überladungen
(15-20,28-33,41-46)
(Überladungen ohne Parameter lhs ) |
|
==
|
lhs. compare ( target ) == 0 | rhs. compare ( target ) == 0 |
!=
|
lhs. compare ( target ) ! = 0 | rhs. compare ( target ) ! = 0 |
<
|
lhs. compare ( target ) < 0 | rhs. compare ( target ) > 0 |
<=
|
lhs. compare ( target ) <= 0 | rhs. compare ( target ) >= 0 |
>
|
lhs. compare ( target ) > 0 | rhs. compare ( target ) < 0 |
>=
|
lhs. compare ( target ) >= 0 | rhs. compare ( target ) <= 0 |
<=>
|
static_cast
<
cat-type-of
<
BidirIt
>>
(
lhs.
compare
(
target
)
<=>
0
)
|
N/V |
Hinweise
Der Rückgabetyp von
operator
<=>
ist garantiert ein Vergleichskategorietyp. Wenn
value-type-of
<
BidirIt
>
char
,
wchar_t
,
char8_t
,
char16_t
oder
char32_t
ist, dann ist der Rückgabetyp von
operator<=>
std::strong_ordering
.
Beispiel
|
Dieser Abschnitt ist unvollständig
Grund: Kein Beispiel |
Fehlerberichte
Die folgenden verhaltensändernden Fehlerberichte wurden rückwirkend auf zuvor veröffentlichte C++-Standards angewendet.
| DR | Angewendet auf | Verhalten wie veröffentlicht | Korrektes Verhalten |
|---|---|---|---|
| LWG 2217 | C++11 |
für Vergleiche mit
std::string
war das
Argument von
compare()
str.
c_str
(
)
|
das Argument ist
string_type ( str. data ( ) , str. size ( ) ) ) |
Siehe auch
|
vergleicht übereinstimmende Teilsequenz (falls vorhanden)
(öffentliche Elementfunktion) |