Namespaces
Variants

operator==,!= (std::match_results)

From cppreference.net
Regular expressions library
Classes
(C++11)
Algorithms
Iterators
Exceptions
Traits
Constants
(C++11)
Regex Grammar
헤더에 정의됨 <regex>
template < class BidirIt, class Alloc >

bool operator == ( match_results < BidirIt,Alloc > & lhs,

match_results < BidirIt,Alloc > & rhs ) ;
(1) (C++11부터)
template < class BidirIt, class Alloc >

bool operator ! = ( match_results < BidirIt,Alloc > & lhs,

match_results < BidirIt,Alloc > & rhs ) ;
(2) (C++11부터)
(C++20까지)

두 개의 match_results 객체를 비교합니다.

match_results 가 다음 조건을 충족하면 동일합니다:

  • 두 객체 중 어느 것도 ready 상태가 아니거나, or
  • 두 match 결과가 모두 ready 상태이고 다음 조건이 충족되는 경우:
  • lhs. empty ( ) 그리고 rhs. empty ( ) , 또는
  • ! lhs. empty ( ) 그리고 ! rhs. empty ( ) 이며 다음 조건들이 충족되는 경우:
  • lhs. prefix ( ) == rhs. prefix ( )
  • lhs. size ( ) == rhs. size ( ) && std:: equal ( lhs. begin ( ) , lhs. end ( ) , rhs. begin ( ) )
  • lhs. suffix ( ) == rhs. suffix ( )
1) lhs rhs 가 동일한지 확인합니다.
2) lhs rhs 가 서로 다른지 확인합니다.

!= 연산자는 합성된 operator== 로부터 생성됩니다.

(C++20부터)

목차

매개변수

lhs, rhs - 비교할 매치 결과
타입 요구사항
-
BidirIt LegacyBidirectionalIterator 요구사항을 충족해야 합니다.
-
Alloc Allocator 요구사항을 충족해야 합니다.

반환값

1) true 만약 lhs rhs 가 동일하면, false 그렇지 않으면.
2) true 만약 lhs rhs 가 서로 같지 않으면, false 그렇지 않으면.

예외

구현 정의 예외를 던질 수 있습니다.

예제