std::error_condition::operator=
來自 cppreference.com
template< class ErrorConditionEnum > error_condition& operator=( ErrorConditionEnum e ) noexcept; |
(1) | (C++11 起) |
error_condition& operator=( const error_condition& other ) = default; |
(2) | (C++11 起) (隱式宣告) |
error_condition& operator=( error_condition&& other ) = default; |
(3) | (C++11 起) (隱式宣告) |
將內容賦值給錯誤條件。
1) 為列舉 `e` 賦值錯誤條件。有效地呼叫 `make_error_condition`,它僅透過對 `e` 的引數依賴查詢找到,然後用結果替換*this。此過載僅在std::is_error_condition_enum<ErrorConditionEnum>::value為true時參與過載決議。
2,3) 隱式定義的複製賦值運算子和移動賦值運算子將 `other` 的內容賦值給*this。
[編輯] 引數
e | - | 錯誤條件列舉 |
其他 | - | 另一個要賦值的錯誤條件 |
[編輯] 返回值
*this.
[編輯] 缺陷報告
下列更改行為的缺陷報告追溯地應用於以前出版的 C++ 標準。
缺陷報告 | 應用於 | 釋出時的行為 | 正確的行為 |
---|---|---|---|
LWG 3629 | C++11 | 只使用了 `std::make_error_condition` 過載 | 使用了 ADL 找到的過載 |