.TH "std::experimental::any" 3cxx "Fri May 28 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::experimental::any \- A type-safe container of any type\&. .SH SYNOPSIS .br .PP .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBany\fP () noexcept" .br .RI "Default constructor, creates an empty object\&. " .ti -1c .RI "template, typename _Mgr = _Manager<_Tp>, typename enable_if< is_constructible< _Tp, _ValueType && >::value, bool >::type = true> \fBany\fP (_ValueType &&__value)" .br .RI "Construct with a copy of \fC__value\fP as the contained object\&. " .ti -1c .RI "template, typename _Mgr = _Manager<_Tp>, typename enable_if::value, bool >::type = 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) noexcept" .br .RI "Move constructor, transfer the state from \fC__other\fP\&. " .ti -1c .RI "\fBany\fP (const \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 "void \fBclear\fP () noexcept" .br .RI "If not empty, destroy the contained object\&. " .ti -1c .RI "_GLIBCXX_NODISCARD bool \fBempty\fP () const noexcept" .br .RI "Reports whether there is a contained object or not\&. " .ti -1c .RI "template \fBenable_if_t\fP >::value, \fBany\fP & > \fBoperator=\fP (_ValueType &&__rhs)" .br .RI "Store a copy of \fC__rhs\fP as the contained object\&. " .ti -1c .RI "\fBany\fP & \fBoperator=\fP (\fBany\fP &&__rhs) noexcept" .br .RI "Move assignment operator\&. " .ti -1c .RI "\fBany\fP & \fBoperator=\fP (const \fBany\fP &__rhs)" .br .RI "Copy the state of another object\&. " .ti -1c .RI "void \fBswap\fP (\fBany\fP &__rhs) noexcept" .br .RI "Exchange state with another object\&. " .ti -1c .RI "const \fBtype_info\fP & \fBtype\fP () const noexcept" .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 static constexpr bool \fB__is_valid_cast\fP ()" .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "template \fBenable_if_t\fP< \fBis_object\fP< _Tp >::value, void * > \fB__any_caster\fP (const \fBany\fP *__any)" .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\&. .PP Definition at line 87 of file any\&. .SH "Constructor & Destructor Documentation" .PP .SS "std::experimental::any::any ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Default constructor, creates an empty object\&. .PP Definition at line 126 of file any\&. .SS "std::experimental::any::any (const \fBany\fP & __other)\fC [inline]\fP" .PP Copy constructor, copies the state of \fC__other\fP\&. .PP Definition at line 129 of file any\&. .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 .PP Definition at line 146 of file any\&. .SS "template, typename _Mgr = _Manager<_Tp>, typename enable_if< is_constructible< _Tp, _ValueType && >::value, bool >::type = true> std::experimental::any::any (_ValueType && __value)\fC [inline]\fP" .PP Construct with a copy of \fC__value\fP as the contained object\&. .PP Definition at line 163 of file any\&. .SS "template, typename _Mgr = _Manager<_Tp>, typename enable_if::value, bool >::type = false> std::experimental::any::any (_ValueType && __value)\fC [inline]\fP" .PP Construct with a copy of \fC__value\fP as the contained object\&. .PP Definition at line 176 of file any\&. .SS "std::experimental::any::~any ()\fC [inline]\fP" .PP Destructor, calls \fCclear()\fP .PP Definition at line 185 of file any\&. .SH "Member Function Documentation" .PP .SS "void std::experimental::any::clear ()\fC [inline]\fP, \fC [noexcept]\fP" .PP If not empty, destroy the contained object\&. .PP Definition at line 227 of file any\&. .SS "_GLIBCXX_NODISCARD bool std::experimental::any::empty () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Reports whether there is a contained object or not\&. .PP Definition at line 269 of file any\&. .SS "template \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\&. .PP Definition at line 218 of file any\&. .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 .PP Definition at line 201 of file any\&. .SS "\fBany\fP& std::experimental::any::operator= (const \fBany\fP & __rhs)\fC [inline]\fP" .PP Copy the state of another object\&. .PP Definition at line 190 of file any\&. .SS "void std::experimental::any::swap (\fBany\fP & __rhs)\fC [inline]\fP, \fC [noexcept]\fP" .PP Exchange state with another object\&. .PP Definition at line 237 of file any\&. .SS "const \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\&. .PP Definition at line 273 of file any\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.