Namespaces
Variants
Views
Actions

std::optional::operator bool

From cppreference.com
constexpr explicit operator bool() const;
(since C++14)

Checks whether *this is in engaged state, i.e. whether the contained value is initialized.

[edit] Parameters

(none)

[edit] Return value

true if *this is in engaged state, false otherwise.

[edit] Exceptions

noexcept specification:  
noexcept
  (since C++11)