##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::any::has_value

From cppreference.com
< cpp‎ | utility‎ | any

bool has_value() const; |  | (since C++17)

Checks whether the object contains a value.

### [edit] Parameters

(none)

### [edit] Return value

true if instance contains a value, otherwise false.

### [edit] Exceptions

`noexcept` specification:
noexcept
Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/utility/any/has_value&oldid=91594"
Category:

- unconditionally noexcept

Hidden categories:

- Pages with unreviewed unconditional noexcept template
- Pages with unreviewed noexcept template