std::basic_regex<CharT,Traits>:: operator=
From cppreference.net
<
cpp
|
regex
|
basic regex
|
定义于头文件
<regex>
|
||
|
basic_regex
&
operator
=
(
const
basic_regex
&
other
)
;
|
(1) | (C++11 起) |
|
basic_regex
&
operator
=
(
basic_regex
&&
other
)
noexcept
;
|
(2) | (C++11 起) |
|
basic_regex
&
operator
=
(
const
CharT
*
ptr
)
;
|
(3) | (C++11 起) |
|
basic_regex
&
operator
=
(
std::
initializer_list
<
CharT
>
il
)
;
|
(4) | (C++11 起) |
|
template
<
class
ST,
class
SA
>
basic_regex & operator = ( const std:: basic_string < CharT,ST,SA > & p ) ; |
(5) | (C++11 起) |
分配内容。
1)
拷贝赋值运算符。将
other
的内容进行赋值。等价于
assign
(
other
)
;
。
2)
移动赋值运算符。使用移动语义分配
other
的内容。操作后
other
处于有效但未指定的状态。等价于
assign
(
other
)
;
。
3)
分配由
ptr
指向的以空字符结尾的字符串。等价于
assign
(
ptr
)
;
。
4)
分配初始化列表
il
中包含的字符。等价于
assign
(
il
)
;
。
5)
将字符串
p
的内容进行赋值。等价于
assign
(
p
)
;
。
目录 |
参数
| other | - | 另一个正则表达式对象 |
| ptr | - | 指向以空字符结尾的字符串的指针 |
| il | - | 包含要分配字符的初始化列表 |
| p | - | 包含要分配字符的字符串 |
返回值
* this
异常
1)
可能抛出实现定义的异常。
3-5)
std::regex_error
如果提供的正则表达式无效。在此情况下对象不会被修改。
参见
|
赋值内容
(公开成员函数) |