Defined in header <regex> | ||
---|---|---|
template< class BidirIt, class Alloc > bool operator==( match_results<BidirIt,Alloc>& lhs, match_results<BidirIt,Alloc>& rhs ); | (1) | (since C++11) |
template< class BidirIt, class Alloc > bool operator!=( match_results<BidirIt,Alloc>& lhs, match_results<BidirIt,Alloc>& rhs ); | (2) | (since C++11) |
Compares two match_results
objects.
Two match_results
are equal if the following conditions are met:
lhs.empty()
and rhs.empty()
, or !lhs.empty()
and !rhs.empty()
and the following conditions are met: lhs.prefix() == rhs.prefix()
lhs.size() == rhs.size() && std::equal(lhs.begin(), lhs.end(), rhs.begin())
lhs.suffix() == rhs.suffix()
lhs
and rhs
are equal.lhs
and rhs
are not equal.lhs, rhs | - | match results to compare |
Type requirements | ||
-BidirIt must meet the requirements of BidirectionalIterator. |
||
-Alloc must meet the requirements of Allocator. |
true
if lhs
and rhs
are equal, false
otherwise.true
if lhs
and rhs
are not equal, false
otherwise.(none).
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/regex/match_results/operator_cmp