名前空間
変種
操作

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

提供: cppreference.com
< cpp‎ | regex‎ | match results
 
 
正規表現ライブラリ
クラス
(C++11)
アルゴリズム
イテレータ
例外
特性
定数
(C++11)
正規表現の文法
 
 
ヘッダ <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以上)

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

以下の条件を満たす場合、2つの match_results は等しくなります。

  • オブジェクトがどちらも準備完了でない。 または
  • マッチ結果がどちらも準備完了であり、以下の条件を満たす。
  • 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) lhsrhs が等しいかどうか調べます。
2) lhsrhs が等しくないかどうか調べます。

目次

[編集] 引数

lhs, rhs - 比較するマッチ結果
型の要件
-
BidirItLegacyBidirectionalIterator の要件を満たさなければなりません。
-
AllocAllocator の要件を満たさなければなりません。

[編集] 戻り値

1) lhsrhs が等しければ true、そうでなければ false
2) lhsrhs が等しくなければ true、そうでなければ false

[編集] 例外

(なし)

[編集]