std::match_results<BidirIt,Alloc>::operator=
来自cppreference.com
< cpp | regex | match results
在标头 <regex> 定义 | ||
match_results& operator=( const match_results& other ); | (1) | |
match_results& operator=( match_results&& other ) noexcept; | (2) | |
赋值内容。
1) 复制赋值运算符。赋值 other 的内容。
2) 移动赋值运算符。用移动语义赋值 other 的内容。操作后 other 处于合法但未指定的状态。
给定 other 在赋值前的值为 m,[
0,
m.size())
中的任意整数为 n,赋值完成时,以下成员函数应返回指定的值:
成员函数 | 值 |
---|---|
ready() | m.ready() |
size() | m.size() |
str(n) | m.str(n) |
prefix() | m.prefix() |
suffix() | m.suffix() |
operator[](n) | m[n] |
length(n) | m.length(n) |
position(n) | m.position(n) |
参数
other | - | 另一匹配结果对象 |
返回值
*this
异常
1) 可能会抛出由实现定义的异常。
缺陷报告
下列更改行为的缺陷报告追溯地应用于以前出版的 C++ 标准。
缺陷报告 | 应用于 | 出版时的行为 | 正确行为 |
---|---|---|---|
LWG 2191 | C++11 | 在后条件中 n 可以为负 | 只能非负 |