table of contents
other versions
- Tumbleweed 2026.11.13-1.1
- Leap-16.0
- Leap-15.6
| std::any::reset(3) | C++ Standard Libary | std::any::reset(3) |
NAME¶
std::any::reset - std::any::reset
Synopsis¶
void reset() noexcept; (since C++17)
If *this contains a value, destroys the contained value.
*this does not contain a value after this call.
Parameters¶
(none)
Return value¶
(none)
Example¶
// Run this code
#include <any> #include <cassert>
int main() {
std::any a{42};
assert(a.has_value());
a.reset();
assert(not a.has_value()); }
See also¶
has_value checks if object holds a value
(public member function)
| 2026.11.10 | http://cppreference.com |