operator==,!=(std::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
起) (C++20 前) |
比较二个 match_results
对象。
若满足下列条件则二个 match_results
相等:
- 无一对象为就绪,或
- 二个 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()
lhs
与 rhs 是否相等。
lhs
与 rhs 是否不相等。
参数
lhs, rhs | - | 要比较的 match_results |
类型要求 | ||
-BidirIt
必须符合老式双向迭代器
(LegacyBidirectionalIterator)
的要求。
|
||
-Alloc
必须符合分配器
(Allocator)
的要求。
|
返回值
lhs
与
rhs
相等则为 true ,否则为 false 。lhs
与
rhs
不相等则为 true ,否则为 false 。异常
可能会抛出由实现定义的异常。
示例
本节未完成 原因:暂无示例 |