Namespaces
Variants

std::any::reset

cppreference.net에서 가져옴
 
 
유틸리티 라이브러리
일반 유틸리티
관계 연산자 (C++20에서 폐기됨)
정수 비교 함수
(C++20)(C++20)(C++20)    
(C++20)
Swap 및 타입 연산
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
공통 어휘 타입
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)



 
 
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)