“cpp/regex/regex token iterator/operator cmp”的版本间的差异
来自cppreference.com
< cpp | regex | regex token iterator
小 (合成) |
小 |
||
第1行: | 第1行: | ||
− | {{cpp/regex/regex_token_iterator/title |operator{{==}}, operator!{{=}}}} | + | {{cpp/regex/regex_token_iterator/title|operator{{==}}, operator!{{=}}}} |
{{cpp/regex/regex_token_iterator/navbar}} | {{cpp/regex/regex_token_iterator/navbar}} | ||
{{dcl begin}} | {{dcl begin}} | ||
− | {{dcl | num=1 | since=c++11 | 1= | + | {{dcl|num=1|since=c++11|1= |
bool operator==( const regex_token_iterator& other ) const; | bool operator==( const regex_token_iterator& other ) const; | ||
}} | }} | ||
− | {{dcl | num=2 | since=c++11 | until=c++20 | 1= | + | {{dcl|num=2|since=c++11|until=c++20|1= |
bool operator!=( const regex_token_iterator& other ) const; | bool operator!=( const regex_token_iterator& other ) const; | ||
}} | }} | ||
{{dcl end}} | {{dcl end}} | ||
− | 检查 {{c|*this}} 与 {{ | + | 检查 {{c|*this}} 与 {{|other}} 是否等价。 |
− | + | 个 相等: | |
− | @a@它们都是序列尾迭代器。 | + | @a@ 它们都是序列尾迭代器。 |
− | @b@它们都是后缀迭代器且后缀相等。 | + | @b@ 它们都是后缀迭代器且后缀相等。 |
− | @c@它们都不是序列尾或后缀迭代器且: | + | @c@ 它们都不是序列尾或后缀迭代器且: |
::* {{c|1=position == other.position}} | ::* {{c|1=position == other.position}} | ||
第24行: | 第24行: | ||
::* {{c|1=subs == other.subs}} | ::* {{c|1=subs == other.subs}} | ||
+ | |||
− | @ | + | @@ 检查 {{c|*this}} 是否'' 等于'' {{|other}}。 |
− | + | {{rrev|since=c++20| | |
− | + | ||
− | {{rrev | since=c++20 | | + | |
{{cpp/note synthesized eq}} | {{cpp/note synthesized eq}} | ||
}} | }} | ||
+ | |||
+ | |||
===参数=== | ===参数=== | ||
{{par begin}} | {{par begin}} | ||
− | {{par | other |要比较的另一 | + | {{par|other|要比较的另一 }} |
{{par end}} | {{par end}} | ||
===返回值=== | ===返回值=== | ||
− | @1@若 {{c|*this}} ''等于'' {{ | + | @1@ 若 {{c|*this}} ''等于'' {{|other}} 则为 {{c|true}},否则为 {{c|false}}。 |
− | @2@若 {{c|*this}} ''不等于'' {{ | + | @2@ 若 {{c|*this}} ''不等于'' {{|other}} 则为 {{c|true}},否则为 {{c|false}}。 |
− | {{langlinks|en|es|ja|ru}} | + | {{langlinks|en|es|ja|ru}} |
2024年3月7日 (四) 10:00的最后版本
bool operator==( const regex_token_iterator& other ) const; |
(1) | (C++11 起) |
bool operator!=( const regex_token_iterator& other ) const; |
(2) | (C++11 起) (C++20 前) |
检查 *this 与 other 是否等价。
以下情况下,两个正则表达式记号迭代器相等:
a) 它们都是序列尾迭代器。
b) 它们都是后缀迭代器且后缀相等。
c) 它们都不是序列尾或后缀迭代器且:
- position == other.position
- N == other.N
- subs == other.subs
1) 检查 *this 是否等于 other。
2) 检查 *this 是否不等于 other。
|
(C++20 起) |
本节未完成 原因:更好的解释。比如, subs 是仅用于阐释的匹配子表达式的向量。 |
[编辑] 参数
other | - | 要比较的另一正则表达式记号迭代器 |
[编辑] 返回值
1) 若 *this 等于 other 则为 true,否则为 false。
2) 若 *this 不等于 other 则为 true,否则为 false。