std::experimental::any(3) Library Functions Manual std::experimental::any(3) NAME std::experimental::any - A type-safe container of any type. SYNOPSIS #include Public Member Functions any () noexcept Default constructor, creates an empty object. template, typename _Mgr = _Manager<_Tp>, typename enable_if< is_constructible< _Tp, _ValueType && >::value, bool >::type = true> any (_ValueType &&__value) Construct with a copy of __value as the contained object. template, typename _Mgr = _Manager<_Tp>, typename enable_if::value, bool >::type = false> any (_ValueType &&__value) Construct with a copy of __value as the contained object. any (any &&__other) noexcept Move constructor, transfer the state from __other. any (const any &__other) Copy constructor, copies the state of __other. ~any () Destructor, calls clear() void clear () noexcept If not empty, destroy the contained object. bool empty () const noexcept Reports whether there is a contained object or not. template enable_if_t >::value, any & > operator= (_ValueType &&__rhs) Store a copy of __rhs as the contained object. any & operator= (any &&__rhs) noexcept Move assignment operator. any & operator= (const any &__rhs) Copy the state of another object. void swap (any &__rhs) noexcept Exchange state with another object. const type_info & type () const noexcept The typeid of the contained object, or typeid(void) if empty. Static Public Member Functions template static constexpr bool __is_valid_cast () Friends template enable_if_t< is_object< _Tp >::value, void * > __any_caster (const any *__any) Detailed Description A type-safe container of any type. An any object's state is either empty or it stores a contained object of CopyConstructible type. Constructor & Destructor Documentation std::experimental::any::any () [inline], [noexcept] Default constructor, creates an empty object. Referenced by operator=(), and operator=(). std::experimental::any::any (const any & __other) [inline] Copy constructor, copies the state of __other. References empty(). std::experimental::any::any (any && __other) [inline], [noexcept] Move constructor, transfer the state from __other. Postcondition __other.empty() (this postcondition is a GNU extension) template, typename _Mgr = _Manager<_Tp>, typename enable_if< is_constructible< _Tp, _ValueType && >::value, bool >::type = true> std::experimental::any::any (_ValueType && __value) [inline] Construct with a copy of __value as the contained object. References std::forward(). template, typename _Mgr = _Manager<_Tp>, typename enable_if::value, bool >::type = false> std::experimental::any::any (_ValueType && __value) [inline] Construct with a copy of __value as the contained object. std::experimental::any::~any () [inline] Destructor, calls clear() References clear(). Member Function Documentation void std::experimental::any::clear () [inline], [noexcept] If not empty, destroy the contained object. References empty(). Referenced by ~any(), and operator=(). bool std::experimental::any::empty () const [inline], [noexcept] Reports whether there is a contained object or not. Referenced by any(), clear(), swap(), and type(). template enable_if_t >::value, any & > std::experimental::any::operator= (_ValueType && __rhs) [inline] Store a copy of __rhs as the contained object. References any(), and std::forward(). any & std::experimental::any::operator= (any && __rhs) [inline], [noexcept] Move assignment operator. Postcondition __rhs.empty() (not guaranteed for other implementations) References clear(), and std::forward(). any & std::experimental::any::operator= (const any & __rhs) [inline] Copy the state of another object. References any(), and std::forward(). void std::experimental::any::swap (any & __rhs) [inline], [noexcept] Exchange state with another object. References empty(), and std::forward(). const type_info & std::experimental::any::type () const [inline], [noexcept] The typeid of the contained object, or typeid(void) if empty. References empty(), and std::forward(). Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ std::experimental::any(3)