operator==,!=(std::match_results)
提供: 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以上) |
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)
lhs
と rhs が等しいかどうか調べます。2)
lhs
と rhs が等しくないかどうか調べます。目次 |
[編集] 引数
lhs, rhs | - | 比較するマッチ結果 |
型の要件 | ||
-BidirIt は LegacyBidirectionalIterator の要件を満たさなければなりません。
| ||
-Alloc は Allocator の要件を満たさなければなりません。
|
[編集] 戻り値
1)
lhs
と rhs
が等しければ true、そうでなければ false。2)
lhs
と rhs
が等しくなければ true、そうでなければ false。[編集] 例外
(なし)
[編集] 例
This section is incomplete Reason: no example |