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

定义于头文件 <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 起)

比较二个 match_results 对象。

若满足下列条件则二个 match_results 相等:

  • lhs.prefix() == rhs.prefix()
  • lhs.size() == rhs.size() && std::equal(lhs.begin(), lhs.end(), rhs.begin())
  • lhs.suffix() == rhs.suffix()
1) 检查 lhsrhs 是否相等。
2) 检查 lhsrhs 是否不相等。

目录

参数

lhs, rhs - 要比较的 match_results
类型要求
-
BidirIt 必须满足 BidirectionalIterator 的要求。
-
Alloc 必须满足 Allocator 的要求。

返回值

1)lhsrhs 相等则为 true ,否则为 false
2)lhsrhs 不相等则为 true ,否则为 false

异常

(无)

示例

版本历史

  • (当前 | 先前 2017年7月28日 (五) 22:35Fruderica讨论 | 贡献. . (1,615字节) (-972). . (撤销)
  • 当前 | 先前 2014年10月26日 (日) 18:06P12bot讨论 | 贡献 . . (2,587字节) (0). . (Fix some translations) (撤销)
  • 当前 | 先前 2013年7月2日 (二) 11:12P12bot讨论 | 贡献 . . (2,587字节) (-117). . (Use {{lc}}. Update links. Various fixes.) (撤销)
  • 当前 | 先前 2012年11月2日 (五) 12:13P12bot讨论 | 贡献 . . (2,704字节) (+353). . (r2.7.3) (机器人添加:de, en, es, fr, it, ja, pt, ru) (撤销)
  • 当前 | 先前 2012年10月27日 (六) 09:07P12讨论 | 贡献 . . (2,351字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 06:00TranslationBot讨论 | 贡献. . (2,351字节) (-87). . (Translated from the English version using Google Translate) (撤销)
  • 当前 | 先前 2012年10月25日 (四) 15:33P12讨论 | 贡献 . . (2,438字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前) 2012年10月25日 (四) 12:00TranslationBot讨论 | 贡献. . (2,438字节) (+2,438). . (Translated from the English version using Google Translate)