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) | ( exposition only* ) |
|
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
)
|
해당 없음 |
참고 사항
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) |