命名空间
变体
操作

std::error_condition::operator=

来自 cppreference.cn
< cpp‎ | 错误‎ | 错误条件
 
 
 
 
 
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>::valuetrue时参与重载决议。
2,3) 隐式定义的复制赋值运算符和移动赋值运算符将 `other` 的内容赋值给*this

[编辑] 参数

e - 错误条件枚举
其他 - 另一个要赋值的错误条件

[编辑] 返回值

*this.

[编辑] 缺陷报告

下列更改行为的缺陷报告追溯地应用于以前出版的 C++ 标准。

缺陷报告 应用于 发布时的行为 正确的行为
LWG 3629 C++11 只使用了 `std::make_error_condition` 重载 使用了 ADL 找到的重载