std::optional::reset - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::optional::reset

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

void reset(); |  | (since C++17)

If *this contains a value, destroy that value as if by value().T::~T(). Otherwise, there are no effects.

*this does not contain a value after this call.

### [edit] Exceptions

`noexcept` specification:
noexcept

### [edit] See also

operator= | assigns contents (public member function) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/utility/optional/reset&oldid=91738"
Category:

- unconditionally noexcept

Hidden categories:

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