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まで)

2つの match_results オブジェクトを比較します。

Two match_results は以下の条件を満たす場合に等しい:

  • どちらのオブジェクトも ready ではない、 or
  • 両方のマッチ結果が 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 if lhs and rhs are not equal, false otherwise.

例外

実装定義の例外をスローする可能性があります。