std::optional<T>::
operator bool,
std::optional<T>::
has_value
<
cpp
|
utility
|
optional
constexpr
explicit
operator
bool
(
)
const
noexcept
;
(C++17 起)
constexpr
bool
has_value
(
)
const
noexcept
;
(C++17 起)
检查
*
this
是否含值。
参数
(无)
返回值
若
*
this
含值则为
true
,若
*
this
不含值则
false
。