Spec-Zone.ru › C++

std::any::reset

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

#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)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/utility/any/reset

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API