operator==,!=,<,<=,>,>=,<=> (std::sub_match)
|
定義済みヘッダー
<regex>
|
||
|
直接比較
|
||
|
template
<
class
BidirIt
>
bool
operator
==
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(1) | (C++11以降) |
|
template
<
class
BidirIt
>
bool
operator
!
=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(2) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
<
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(3) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
<=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(4) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(5) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
>=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(6) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
auto
operator
<=>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(7) | (C++20以降) |
|
std::basic_string
との比較
|
||
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
==
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(8) | (C++11以降) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
!
=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(9) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
<
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(10) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
<=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(11) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(12) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
>=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(13) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
auto
operator
<=>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(14) | (C++20以降) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
==
(
const
std::
basic_string
<
/*value-type-of*/
<
BidirIt
>
,
|
(15) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
!
=
(
const
std::
basic_string
<
/*value-type-of*/
<
BidirIt
>
,
|
(16) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
<
(
const
std::
basic_string
<
/*value-type-of*/
<
BidirIt
>
,
|
(17) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
<=
(
const
std::
basic_string
<
/*value-type-of*/
<
BidirIt
>
,
|
(18) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
>
(
const
std::
basic_string
<
/*value-type-of*/
<
BidirIt
>
,
|
(19) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt,
class
Traits,
class
Alloc
>
bool
operator
>=
(
const
std::
basic_string
<
/*value-type-of*/
<
BidirIt
>
,
|
(20) |
(C++11以降)
(C++20まで) |
|
Cスタイル文字列との比較
|
||
|
template
<
class
BidirIt
>
bool
operator
==
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(21) | (C++11以降) |
|
template
<
class
BidirIt
>
bool
operator
!
=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(22) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
<
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(23) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
<=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(24) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(25) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
>=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(26) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
auto
operator
<=>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(27) | (C++20以降) |
|
template
<
class
BidirIt
>
bool
operator
==
(
const
/*value-type-of*/
<
BidirIt
>
*
s,
|
(28) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
!
=
(
const
/*value-type-of*/
<
BidirIt
>
*
s,
|
(29) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
<
(
const
/*value-type-of*/
<
BidirIt
>
*
s,
|
(30) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
<=
(
const
/*value-type-of*/
<
BidirIt
>
*
s,
|
(31) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
>
(
const
/*value-type-of*/
<
BidirIt
>
*
s,
|
(32) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
>=
(
const
/*value-type-of*/
<
BidirIt
>
*
s,
|
(33) |
(C++11以降)
(C++20まで) |
|
単一文字との比較
|
||
|
template
<
class
BidirIt
>
bool
operator
==
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(34) | (C++11以降) |
|
template
<
class
BidirIt
>
bool
operator
!
=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(35) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
<
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(36) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
<=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(37) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(38) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
>=
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(39) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
auto
operator
<=>
(
const
std::
sub_match
<
BidirIt
>
&
lhs,
|
(40) | (C++20以降) |
|
template
<
class
BidirIt
>
bool
operator
==
(
const
/*value-type-of*/
<
BidirIt
>
&
ch,
|
(41) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
!
=
(
const
/*value-type-of*/
<
BidirIt
>
&
ch,
|
(42) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
<
(
const
/*value-type-of*/
<
BidirIt
>
&
ch,
|
(43) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
<=
(
const
/*value-type-of*/
<
BidirIt
>
&
ch,
|
(44) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
>
(
const
/*value-type-of*/
<
BidirIt
>
&
ch,
|
(45) |
(C++11以降)
(C++20まで) |
|
template
<
class
BidirIt
>
bool
operator
>=
(
const
/*value-type-of*/
<
BidirIt
>
&
ch,
|
(46) |
(C++11以降)
(C++20まで) |
|
ヘルパー型エイリアス
|
||
|
template
<
class
BidirIt
>
using
/*value-type-of*/
=
|
(47) | ( 説明専用* ) |
|
template
<
class
BidirIt
>
using
/*cat-type-of*/
=
|
(48) |
(C++20以降)
( 説明専用* ) |
sub_match
を別の
sub_match
、
std::string
、C形式文字列、または単一文字と比較します。
sub_match
を直接比較します。
sub_match
をCスタイル文字列と比較します。
sub_match
を単一文字と比較します。
|
|
(C++20以降) |
目次 |
パラメータ
| lhs, rhs | - |
比較対象の
sub_match
|
| str | - | 比較対象の std::basic_string |
| s | - | 比較対象のCスタイル文字列へのポインタ |
| ch | - | 比較対象の文字 |
戻り値
以下の値で target を設定します:
戻り値は以下のように定義されています:
| 演算子 | 戻り値 | |
|---|---|---|
|
オーバーロード
(1-14,21-27,34-40)
(パラメータ lhs を持つオーバーロード) |
オーバーロード
(15-20,28-33,41-46)
(パラメータ 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/A |
注記
operator
<=>
の戻り値の型は、比較カテゴリ型であることが保証されています。
value-type-of
<
BidirIt
>
が
char
、
wchar_t
、
char8_t
、
char16_t
または
char32_t
の場合、
operator<=>
の戻り値の型は
std::strong_ordering
です。
例
|
このセクションは不完全です
理由: 例がありません |
不具合報告
以下の動作変更の欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。
| DR | 適用対象 | 公開時の動作 | 正しい動作 |
|---|---|---|---|
| LWG 2217 | C++11 |
std::string
との比較において、
compare()
の引数は
str.
c_str
(
)
であった
|
引数は
string_type ( str. data ( ) , str. size ( ) ) ) である |
関連項目
|
マッチした部分シーケンス(存在する場合)を比較する
(public member function) |