std::expected<T,E>::error
来自cppreference.com
工具库
std::expected
| 成员函数 | ||||
| 观察器 | ||||
|
expected::error
|
||||
| 单子函数 | ||||
| 修改器 | ||||
| 非成员函数 | ||||
| 辅助类 | ||||
|
constexpr
const
E&
error()
const&
noexcept;
|
(1) | (C++23 起) |
|
constexpr
E&
error()
&
noexcept;
|
(2) | (C++23 起) |
|
constexpr
const
E&&
error()
const&&
noexcept;
|
(3) | (C++23 起) |
|
constexpr
E&&
error()
&&
noexcept;
|
(4) | (C++23 起) |
访问 *this 中含有的不期待的值。
若 this->has_value()
为 true 则行为未定义。
参数
(无)
返回值
到 *this 中含有的不期待的值的引用。
示例
| 本节未完成 原因:暂无示例 |
参阅
| 返回期待的值 (公开成员函数) |
|
| 返回期待的值 (公开成员函数) |
|
| 检查对象是否含有期待的值 (公开成员函数) |