std::expected<T,E>::~expected
来自 cppreference.cn
constexpr ~expected(); |
(since C++23) | |
[编辑] 主模板析构函数
销毁包含的值
- 如果
has_value()
为 true,则销毁 expected 值。 - 否则,销毁 unexpected 值。
如果 std::is_trivially_destructible_v<T> 和 std::is_trivially_destructible_v<E> 均为 true,则此析构函数是平凡的。
[编辑] void 部分特化析构函数
如果 has_value()
为 false,则销毁 unexpected 值。
如果 std::is_trivially_destructible_v<E> 为 true,则此析构函数是平凡的。
[编辑] 示例
本节尚不完整 原因:没有示例 |