.TH "std::experimental::any" 3cxx "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::experimental::any \- A type-safe container of any type\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBany\fP () \fBnoexcept\fP" .br .RI "Default constructor, creates an empty object\&. " .ti -1c .RI "template<\fBtypename\fP _ValueType , \fBtypename\fP _Tp = _Decay<_ValueType>, \fBtypename\fP \fB_Mgr\fP = _Manager<_Tp>, \fBtypename\fP \fBenable_if\fP< \fBis_constructible\fP< _Tp, _ValueType && >::value, bool >\fB::type\fP = true> \fBany\fP (_ValueType &&__value)" .br .RI "Construct with a copy of \fC__value\fP as the contained object\&. " .ti -1c .RI "template<\fBtypename\fP _ValueType , \fBtypename\fP _Tp = _Decay<_ValueType>, \fBtypename\fP \fB_Mgr\fP = _Manager<_Tp>, \fBtypename\fP \fBenable_if\fP::value, bool >\fB::type\fP = false> \fBany\fP (_ValueType &&__value)" .br .RI "Construct with a copy of \fC__value\fP as the contained object\&. " .ti -1c .RI "\fBany\fP (\fBany\fP &&__other) \fBnoexcept\fP" .br .RI "Move constructor, transfer the state from \fC__other\fP\&. " .ti -1c .RI "\fBany\fP (\fBconst\fP \fBany\fP &__other)" .br .RI "Copy constructor, copies the state of \fC__other\fP\&. " .ti -1c .RI "\fB~any\fP ()" .br .RI "Destructor, calls \fCclear()\fP " .ti -1c .RI "\fBvoid\fP \fBclear\fP () \fBnoexcept\fP" .br .RI "If not empty, destroy the contained object\&. " .ti -1c .RI "bool \fBempty\fP () \fBconst\fP \fBnoexcept\fP" .br .RI "Reports whether there is a contained object or not\&. " .ti -1c .RI "template<\fBtypename\fP _ValueType > \fBenable_if_t\fP >::value, \fBany\fP & > \fBoperator=\fP (_ValueType &&\fB__rhs\fP)" .br .RI "Store a copy of \fC__rhs\fP as the contained object\&. " .ti -1c .RI "\fBany\fP & \fBoperator=\fP (\fBany\fP &&\fB__rhs\fP) \fBnoexcept\fP" .br .RI "Move assignment operator\&. " .ti -1c .RI "\fBany\fP & \fBoperator=\fP (\fBconst\fP \fBany\fP &\fB__rhs\fP)" .br .RI "Copy the state of another object\&. " .ti -1c .RI "\fBvoid\fP \fBswap\fP (\fBany\fP &\fB__rhs\fP) \fBnoexcept\fP" .br .RI "Exchange state with another object\&. " .ti -1c .RI "\fBconst\fP \fBtype_info\fP & \fBtype\fP () \fBconst\fP \fBnoexcept\fP" .br .RI "The \fCtypeid\fP of the contained object, or \fCtypeid(void)\fP if empty\&. " .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "template<\fBtypename\fP _Tp > \fBstatic\fP \fBconstexpr\fP bool \fB__is_valid_cast\fP ()" .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "template<\fBtypename\fP _Tp > \fBenable_if_t\fP< \fBis_object\fP< _Tp >::value, \fBvoid\fP * > \fB__any_caster\fP (\fBconst\fP \fBany\fP *\fB__any\fP)" .br .in -1c .SH "Detailed Description" .PP A type-safe container of any type\&. An \fCany\fP object's state is either empty or it stores a contained object of CopyConstructible type\&. .SH "Constructor & Destructor Documentation" .PP .SS "std::experimental::any::any ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Default constructor, creates an empty object\&. .SS "std::experimental::any::any (\fBconst\fP \fBany\fP & __other)\fC [inline]\fP" .PP Copy constructor, copies the state of \fC__other\fP\&. .SS "std::experimental::any::any (\fBany\fP && __other)\fC [inline]\fP, \fC [noexcept]\fP" .PP Move constructor, transfer the state from \fC__other\fP\&. .PP \fBPostcondition\fP .RS 4 \fC__other\&.empty()\fP (this postcondition is a GNU extension) .RE .PP .SS "template<\fBtypename\fP _ValueType , \fBtypename\fP _Tp = _Decay<_ValueType>, \fBtypename\fP \fB_Mgr\fP = _Manager<_Tp>, \fBtypename\fP \fBenable_if\fP< \fBis_constructible\fP< _Tp, _ValueType && >::value, bool >\fB::type\fP = true> std::experimental::any::any (_ValueType && __value)\fC [inline]\fP" .PP Construct with a copy of \fC__value\fP as the contained object\&. .SS "template<\fBtypename\fP _ValueType , \fBtypename\fP _Tp = _Decay<_ValueType>, \fBtypename\fP \fB_Mgr\fP = _Manager<_Tp>, \fBtypename\fP \fBenable_if\fP::value, bool >\fB::type\fP = false> std::experimental::any::any (_ValueType && __value)\fC [inline]\fP" .PP Construct with a copy of \fC__value\fP as the contained object\&. .SS "std::experimental::any::~any ()\fC [inline]\fP" .PP Destructor, calls \fCclear()\fP .SH "Member Function Documentation" .PP .SS "\fBvoid\fP std::experimental::any::clear ()\fC [inline]\fP, \fC [noexcept]\fP" .PP If not empty, destroy the contained object\&. .SS "bool std::experimental::any::empty () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Reports whether there is a contained object or not\&. .SS "template<\fBtypename\fP _ValueType > \fBenable_if_t\fP >::value, \fBany\fP & > std::experimental::any::operator= (_ValueType && __rhs)\fC [inline]\fP" .PP Store a copy of \fC__rhs\fP as the contained object\&. .SS "\fBany\fP & std::experimental::any::operator= (\fBany\fP && __rhs)\fC [inline]\fP, \fC [noexcept]\fP" .PP Move assignment operator\&. .PP \fBPostcondition\fP .RS 4 \fC__rhs\&.empty()\fP (not guaranteed for other implementations) .RE .PP .SS "\fBany\fP & std::experimental::any::operator= (\fBconst\fP \fBany\fP & __rhs)\fC [inline]\fP" .PP Copy the state of another object\&. .SS "\fBvoid\fP std::experimental::any::swap (\fBany\fP & __rhs)\fC [inline]\fP, \fC [noexcept]\fP" .PP Exchange state with another object\&. .SS "\fBconst\fP \fBtype_info\fP & std::experimental::any::type () const\fC [inline]\fP, \fC [noexcept]\fP" .PP The \fCtypeid\fP of the contained object, or \fCtypeid(void)\fP if empty\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.