19 General utilities library [utilities]

19.8 Storage for any type [any]

19.8.3 Class any [any.class]

19.8.3.4 Observers [any.observers]

bool has_value() const noexcept;
Returns: true if *this contains an object, otherwise false.
const type_info& type() const noexcept;
Returns: typeid(T) if *this has a contained value of type T, otherwise typeid(void).
[Note
:
Useful for querying against types known either at compile time or only at runtime.
end note
]