std::optional<T>::reset_C++中文网

void reset() noexcept;

(C++17 起)

*this 含值,则如同用 value().T::~T() 销毁此值。否则无效果。

*this 在此调用后不含值。

参阅

对内容赋值
(公开成员函数)