名稱空間
變體
操作

std::expected<T,E>::~expected

來自 cppreference.com
< cpp‎ | 工具庫‎ | expected
 
 
 
 
constexpr ~expected();
(C++23 起)

[編輯] 主模板解構函式

銷燬所包含的值

  • has_value()true,則銷燬預期值。
  • 否則,銷燬非預期值。

std::is_trivially_destructible_v<T>std::is_trivially_destructible_v<E> 皆為 true,則此解構函式為平凡的。

[編輯] void 部分特化解構函式

has_value()false,則銷燬非預期值。

std::is_trivially_destructible_v<E>true,則此解構函式為平凡的。

[編輯] 示例