std::basic_regex<CharT,Traits>::operator=
來自 cppreference.com
< 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] 引數
其他 | - | 另一個正則表示式物件 |
ptr | - | 指向空終止字元字串的指標 |
il | - | 包含要賦值字元的初始化列表 |
p | - | 包含要賦值字元的字串 |
[edit] 返回值
*this
[edit] 異常
1) 可能會丟擲實現定義的異常。
3-5) 如果提供的正則表示式無效,則丟擲 std::regex_error。在這種情況下,物件不會被修改。
[edit] 參閱
賦值內容 (公共成員函式) |