std::error_code::operator=
來自 cppreference.com
template< class ErrorCodeEnum > error_code& operator=( ErrorCodeEnum e ) noexcept; |
(1) | (C++11 起) |
error_code& operator=( const error_code& other ) = default; |
(2) | (C++11 起) (隱式宣告) |
error_code& operator=( error_code&& other ) = default; |
(3) | (C++11 起) (隱式宣告) |
1) 將錯誤碼和對應的類別替換為表示錯誤碼列舉 e 的那些。
等價於 *this = make_error_code(e),其中 make_error_code
僅透過實參依賴查詢找到。
2,3) 隱式定義的複製賦值運算子和移動賦值運算子將 other 的內容賦給 *this。
目錄 |
[編輯] 引數
e | - | 要構造的錯誤碼列舉 |
其他 | - | 另一個要賦值的錯誤碼 |
[編輯] 返回值
*this
[編輯] 缺陷報告
下列更改行為的缺陷報告追溯地應用於以前出版的 C++ 標準。
缺陷報告 | 應用於 | 釋出時的行為 | 正確的行為 |
---|---|---|---|
LWG 3629 | C++11 | 只使用了 std::make_error_code 過載 |
使用了 ADL 找到的過載 |
[編輯] 參閱
賦值另一個錯誤碼 (public member function) |