std::experimental::optional::operator bool - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::experimental::optional::operator bool

From cppreference.com
< cpp‎ | experimental‎ | optional

constexpr explicit operator bool() const; |  | (library fundamentals TS)

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
Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/experimental/optional/operator_bool&oldid=68168"
Category:

- unconditionally noexcept