std::optional<T>::operator bool, std::optional<T>::has_value_C++中文网

C++ 参考手册

位置:首页 > C++ 参考手册 >工具库 >std::optional > std::optional<T>::operator bool, std::optional<T>::has_value

检查 *this 是否含值。

参数

(无)

返回值

若 *this 含值则为 true ,若 *this 不含值则 false 。