Namespaces
Variants

std::error_condition:: operator=

From cppreference.net
Utilities library
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 分配错误条件。有效调用仅通过 e 实参依赖查找 找到的 make_error_condition ,随后将 * this 替换为结果。此重载仅当 std:: is_error_condition_enum < ErrorConditionEnum > :: value true 时参与重载决议。
2,3) 隐式定义的复制赋值运算符和移动赋值运算符将 other 的内容赋值给 * this

参数

e - 错误条件枚举
other - 用于赋值的另一个错误条件

返回值

* this

缺陷报告

以下行为变更缺陷报告被追溯应用于先前发布的C++标准。

缺陷报告 适用范围 发布时行为 正确行为
LWG 3629 C++11 仅使用 std::make_error_condition 重载 使用 ADL 查找到的重载