std::basic_regex<CharT,Traits>::operator=
来自 cppreference.cn
< 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);。
内容 |
[edit] 参数
other | - | 另一个正则表达式对象 |
ptr | - | 指向空终止字符字符串的指针 |
il | - | 包含要赋值字符的初始化列表 |
p | - | 包含要赋值字符的字符串 |
[edit] 返回值
*this
[edit] 异常
1) 可能抛出实现定义的异常。
3-5) 如果提供的正则表达式无效,则抛出 std::regex_error 。 在这种情况下,对象不会被修改。
[edit] 参见
赋值内容 (公开成员函数) |