Namespaces
Variants

std::any:: reset

From cppreference.net
Utilities library
void reset ( ) noexcept ;
(C++17부터)

만약 * this 가 값을 포함하고 있다면, 포함된 값을 파괴합니다.

* this 는 이 호출 이후 값을 포함하지 않습니다.

목차

매개변수

(없음)

반환값

(없음)

예제

#include <any>
#include <cassert>
int main()
{
    std::any a{42};
    assert(a.has_value());
    a.reset();
    assert(not a.has_value());
}

참고 항목

객체가 값을 보유하고 있는지 확인
(public member function)