Namespaces
Variants

std:: unexpect_t, std:: unexpect

From cppreference.net
Utilities library
定义于头文件 <expected>
struct unexpect_t { explicit unexpect_t ( ) = default ; } ;
(1) (C++23 起)
inline constexpr std :: unexpect_t unexpect { } ;
(2) (C++23 起)
1) 用于在 std::expected 对象中原位构造意外值的标签类型。
2) 一个类型为 const std :: unexpect_t 的常量,通常直接传递给 std::expected 的构造函数以构造一个非预期值。

注释

与其他构造标签类型类似, unexpect_t 是一个具有显式默认构造函数的平凡空类。

参见

构造 expected 对象
(公开成员函数)
原位构造标签
(标签)