首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

operators (std::match_results)

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:

  • neither of the objects is ready, or
  • both match results are ready and 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()

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

代码语言:txt
复制
 ? cppreference.com

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com