operator==,!=(std::match_results)
From cppreference.com
< cpp | regex | match results
| ヘッダ <regex> で定義 |
||
| template< class BidirIt, class Alloc > bool operator==( match_results<BidirIt,Alloc>& lhs, |
(1) | (C++11以降) |
| template< class BidirIt, class Alloc > bool operator!=( match_results<BidirIt,Alloc>& lhs, |
(2) | (C++11以降) (C++20まで) |
2つのmatch_resultsオブジェクトを比較します。
次の条件が満たされている場合、2つのmatch_resultsは等しいとみなされます。
- どちらのオブジェクトもreadyではない、*または*
- 両方のマッチ結果が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 が等しくないかどうかをチェックします。
|
|
(C++20以降) |
目次 |
[編集] パラメータ
| lhs, rhs | - | 比較するマッチ結果 |
| 型要件 | ||
-BidirIt は LegacyBidirectionalIterator の要件を満たしている必要があります。 | ||
-Alloc は Allocator の要件を満たす必要があります。 | ||
[編集] 戻り値
1) true、lhs と rhs が等しい場合。false、それ以外の場合。
2) true、lhs と rhs が等しくない場合。false、それ以外の場合。
[編集] 例外
実装定義の例外をスローする場合があります。
[編集] 例
| このセクションは未完成です 理由: 例がありません |