std::optional<T>::operatorbool,std::optional<T>::has_value (3) - Linux Manuals

std::optional<T>::operatorbool,std::optional<T>::has_value: std::optional<T>::operatorbool,std::optional<T>::has_value

NAME

std::optional<T>::operatorbool,std::optional<T>::has_value - std::optional<T>::operatorbool,std::optional<T>::has_value

Synopsis


constexpr explicit operator bool() const noexcept; (since C++17)
constexpr bool has_value() const noexcept; (since C++17)


Checks whether *this contains a value.

Parameters


(none)

Return value


true if *this contains a value, false if *this does not contain a value.