在线文档教程
C++
规律表达 | Regular expressions

operators (std::match_results)

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

Defined in header
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:

  • neither of the objects is ready, or

1) Checks if lhs and rhs are equal.

2) Checks if lhs and rhs are not equal.

Parameters

lhs, rhs-match results to compare

| Type requirements |

| -BidirIt must meet the requirements of BidirectionalIterator. |

| -Alloc must meet the requirements of Allocator. |

Return value

1) true if lhs and rhs are equal, false otherwise.

2) true if lhs and rhs are not equal, false otherwise.

Exceptions

(none).

Example

© cppreference.com

Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.

http://en.cppreference.com/w/cpp/regex/match_results/operator_cmp