operator==,!=(std::match_results)
提供: cppreference.com
<tbody>
</tbody>
| ヘッダ <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)
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 |