.TH "std::experimental::any" 3 "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::experimental::any \- A type-safe container of any type\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBany\fP () noexcept" .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 \fR__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 \fR__value\fP as the contained object\&. " .ti -1c .RI "\fBany\fP (\fBany\fP &&__other) noexcept" .br .RI "Move constructor, transfer the state from \fR__other\fP\&. " .ti -1c .RI "\fBany\fP (const \fBany\fP &__other)" .br .RI "Copy constructor, copies the state of \fR__other\fP\&. " .ti -1c .RI "\fB~any\fP ()" .br .RI "Destructor, calls \fRclear()\fP " .ti -1c .RI "\fBvoid\fP \fBclear\fP () noexcept" .br .RI "If not empty, destroy the contained object\&. " .ti -1c .RI "bool \fBempty\fP () const noexcept" .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 \fR__rhs\fP as the contained object\&. " .ti -1c .RI "\fBany\fP & \fBoperator=\fP (\fBany\fP &&\fB__rhs\fP) noexcept" .br .RI "Move assignment operator\&. " .ti -1c .RI "\fBany\fP & \fBoperator=\fP (const \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) noexcept" .br .RI "Exchange state with another object\&. " .ti -1c .RI "const \fBtype_info\fP & \fBtype\fP () const noexcept" .br .RI "The \fRtypeid\fP of the contained object, or \fRtypeid(void)\fP if empty\&. " .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "template<\fBtypename\fP _Tp > \fBstatic\fP constexpr 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 (const \fBany\fP *\fB__any\fP)" .br .in -1c .SH "Detailed Description" .PP A type-safe container of any type\&. An \fRany\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 ()\fR [inline]\fP, \fR [noexcept]\fP" .PP Default constructor, creates an empty object\&. .PP Referenced by \fBoperator=()\fP, and \fBoperator=()\fP\&. .SS "std::experimental::any::any (const \fBany\fP & __other)\fR [inline]\fP" .PP Copy constructor, copies the state of \fR__other\fP\&. .PP References \fBempty()\fP\&. .SS "std::experimental::any::any (\fBany\fP && __other)\fR [inline]\fP, \fR [noexcept]\fP" .PP Move constructor, transfer the state from \fR__other\fP\&. .PP \fBPostcondition\fP .RS 4 \fR__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)\fR [inline]\fP" .PP Construct with a copy of \fR__value\fP as the contained object\&. .PP References \fBstd::forward()\fP\&. .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)\fR [inline]\fP" .PP Construct with a copy of \fR__value\fP as the contained object\&. .SS "std::experimental::any::~any ()\fR [inline]\fP" .PP Destructor, calls \fRclear()\fP .PP References \fBclear()\fP\&. .SH "Member Function Documentation" .PP .SS "\fBvoid\fP std::experimental::any::clear ()\fR [inline]\fP, \fR [noexcept]\fP" .PP If not empty, destroy the contained object\&. .PP References \fBempty()\fP\&. .PP Referenced by \fB~any()\fP, and \fBoperator=()\fP\&. .SS "bool std::experimental::any::empty () const\fR [inline]\fP, \fR [noexcept]\fP" .PP Reports whether there is a contained object or not\&. .PP Referenced by \fBany()\fP, \fBclear()\fP, \fBswap()\fP, and \fBtype()\fP\&. .SS "template<\fBtypename\fP _ValueType > \fBenable_if_t\fP >::value, \fBany\fP & > std::experimental::any::operator= (_ValueType && __rhs)\fR [inline]\fP" .PP Store a copy of \fR__rhs\fP as the contained object\&. .PP References \fBany()\fP, and \fBstd::forward()\fP\&. .SS "\fBany\fP & std::experimental::any::operator= (\fBany\fP && __rhs)\fR [inline]\fP, \fR [noexcept]\fP" .PP Move assignment operator\&. .PP \fBPostcondition\fP .RS 4 \fR__rhs\&.empty()\fP (not guaranteed for other implementations) .RE .PP .PP References \fBclear()\fP, and \fBstd::forward()\fP\&. .SS "\fBany\fP & std::experimental::any::operator= (const \fBany\fP & __rhs)\fR [inline]\fP" .PP Copy the state of another object\&. .PP References \fBany()\fP, and \fBstd::forward()\fP\&. .SS "\fBvoid\fP std::experimental::any::swap (\fBany\fP & __rhs)\fR [inline]\fP, \fR [noexcept]\fP" .PP Exchange state with another object\&. .PP References \fBempty()\fP, and \fBstd::forward()\fP\&. .SS "const \fBtype_info\fP & std::experimental::any::type () const\fR [inline]\fP, \fR [noexcept]\fP" .PP The \fRtypeid\fP of the contained object, or \fRtypeid(void)\fP if empty\&. .PP References \fBempty()\fP, and \fBstd::forward()\fP\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.