Experimental library header <experimental/any> - cppreference.com

From cppreference.com

This header is part of the Library Fundamentals TS (

v1

,

v2

).

Classes

Name Description (library fundamentals TS)

exception that is thrown by a failed any_cast.
(class)(library fundamentals TS)

Objects that hold instances of any type that satisfies the ValueType requirements.
(class)Functions

swaps two any instances
(function)

[edit]

type-safe access to the contained object
(function template)

[edit]

Synopsis

namespacestd{namespaceexperimental{inlinenamespacefundamentals_v1{classbad_any_cast:publicbad_cast{public:virtualconstchar*what()constnoexcept;};classany{public:// 6.3.1, any construct/destructany()noexcept;any(constany&other);any(any&&x)noexcept;template<classValueType>any(ValueType&&value);~any();// 6.3.2, any assignmentsany&operator=(constany&rhs);any&operator=(any&&rhs)noexcept;template<classValueType>any&operator=(ValueType&&rhs);// 6.3.3, any modifiersvoidclear()noexcept;voidswap(any&rhs)noexcept;// 6.3.4, any observersboolempty()constnoexcept;consttype_info&type()constnoexcept;};// 6.4, Non-member functionsvoidswap(any&x,any&y)noexcept;template<classValueType>ValueTypeany_cast(constany&operand);template<classValueType>ValueTypeany_cast(any&operand);template<classValueType>ValueTypeany_cast(any&&operand);template<classValueType>constValueType*any_cast(constany*operand)noexcept;template<classValueType>ValueType*any_cast(any*operand)noexcept;}// namespace fundamentals_v1}// namespace experimental}// namespace std