std::expected<T,E>::error
來自 cppreference.com
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 中包含的意外值。
如果 has_value()
為 true,則行為未定義。
[編輯] 返回值
1,2)
unex
3,4) std::move(
unex
)[編輯] 示例
本節不完整 原因:無示例 |
[編輯] 參閱
如果存在則返回意外值,否則返回另一個值 (public member function) | |
訪問預期值 (public member function) | |
返回預期值 (public member function) | |
檢查物件是否包含預期值 (public member function) |