std::basic_regex<CharT,Traits>::assign
出自cppreference.com
< cpp | regex | basic regex
basic_regex& assign( const basic_regex& other ); |
(1) | (C++11 起) |
basic_regex& assign( basic_regex&& other ) noexcept; |
(2) | (C++11 起) |
basic_regex& assign( const CharT* s, flag_type f = std::regex_constants::ECMAScript ); |
(3) | (C++11 起) |
basic_regex& assign( const CharT* ptr, std::size_t count, flag_type f = std::regex_constants::ECMAScript ); |
(4) | (C++11 起) |
template< class ST, class SA > basic_regex& assign( const std::basic_string<CharT,ST,SA>& str, |
(5) | (C++11 起) |
template< class InputIt > basic_regex& assign( InputIt first, InputIt last, |
(6) | (C++11 起) |
basic_regex& assign( std::initializer_list<CharT> ilist, flag_type f = std::regex_constants::ECMAScript ); |
(7) | (C++11 起) |
賦值內容給正則表達式。
2) 用移動語義賦值
other
的內容。flags() 和 mark_count() 等價於 other.flags() 和 other.mark_count() 在賦值前的值。調用後,other
處於合法但未指定的狀態。3) 賦值 s 所指向的空終止字元串。
4) 賦值 s 所指向的 count 個字元序列。
5) 賦值字元串 str。
6) 賦值範圍
[
first,
last)
中的字元。7) 賦值初始化式列表 ilist 中的字元。
目錄 |
[編輯] 參數
other | - | 要賦值的另一正則表達式 |
s | - | 指向要賦值的字元序列的指針 |
str | - | 要賦值的字元串 |
first, last | - | 要賦值的字元範圍 |
ilist | - | 含要賦值的字元的初始化式列表 |
類型要求 | ||
-InputIt 必須滿足老式輸入迭代器 (LegacyInputIterator) 。
|
[編輯] 返回值
*this
[編輯] 異常
1) 可能會拋出由實現定義的異常。
3-7) 若提供的正則表達式非法則為 std::regex_error。該情況下不修改對象。
[編輯] 示例
本節未完成 原因:暫無示例 |
[編輯] 參閱
賦值內容 (公開成員函數) |