std::experimental::any(3cxx)
NAME π
Manual page: std::experimental::any(3cxx) β okay bestie, thatβs the manual name folded in right here. std::experimental::any is a type-safe container of any type. Thatβs the whole name vibe β¨.
SYNOPSIS π¦
Include it like this, no cap:
#include <any>
Public Member Functions π
any () noexceptβ default constructor: creates an empty object.- Templated constructor #1 β the
is_constructible< _Tp, _ValueType && >::valueflavor. Exact signature:
template<typename _ValueType , typename _Tp = _Decay<_ValueType>,
typename _Mgr = _Manager<_Tp>, typename enable_if<
is_constructible< _Tp, _ValueType && >::value, bool >::type = true>
any (_ValueType &&__value)
Constructs the contained object from a copy of __value π.
- Templated constructor #2 β the
!is_constructible< _Tp, _ValueType && >::valueflavor. Exact signature:
template<typename _ValueType , typename _Tp = _Decay<_ValueType>,
typename _Mgr = _Manager<_Tp>, typename
enable_if<!is_constructible< _Tp, _ValueType && >::value, bool
>::type = false> any (_ValueType &&__value)
Constructs the contained object from a copy of __value too, just with the opposite enable-if situation π«Ά.
any (any &&__other) noexceptβ move constructor; transfers the state from__other.any (const any &__other)β copy constructor; copies the state of__other.~any ()β destructor; callsclear().void clear () noexceptβ if itβs not empty, destroy the contained object.bool empty () const noexceptβ reports whether there is a contained object or not.- Templated
operator=β stores a copy of__rhsas the contained object. Exact signature:
template<typename _ValueType > enable_if_t<!is_same< any, decay_t<
_ValueType > >::value, any & > operator= (_ValueType &&__rhs)
any & operator= (any &&__rhs) noexceptβ move assignment operator.any & operator= (const any &__rhs)β copies the state of another object.void swap (any &__rhs) noexceptβ exchanges state with another object.const type_info & type () const noexceptβ thetypeidof the contained object, ortypeid(void)if empty.
Static Public Member Functions πΈ
template<typename _Tp > static constexpr bool __is_valid_cast ()β thatβs the static member function exactly as listed, bestie.
Friends π
__any_casterβ exact declaration:
template<typename _Tp > enable_if_t< is_object< _Tp >::value, void * >
__any_caster (const any *__any)
Detailed Description π¦
Okay so std::experimental::any is a type-safe container of any type β¨.
An any objectβs state is either empty, or it stores a contained object of CopyConstructible type. Thatβs the vibe check, periodt π
.
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, transfers the state from __other.
Postcondition: __other.empty() (this postcondition is a GNU extension) π
std::experimental::any::any (_ValueType && __value) β the is_constructible< _Tp, _ValueType && >::value version [inline]
Exact signature:
template<typename _ValueType , typename _Tp = _Decay<_ValueType>, typename
_Mgr = _Manager<_Tp>, typename enable_if< is_constructible< _Tp,
_ValueType && >::value, bool >::type = true>
std::experimental::any::any (_ValueType && __value) [inline]
Constructs the contained object from a copy of __value π.
std::experimental::any::any (_ValueType && __value) β the !is_constructible< _Tp, _ValueType && >::value version [inline]
Exact signature:
template<typename _ValueType , typename _Tp = _Decay<_ValueType>, typename
_Mgr = _Manager<_Tp>, typename enable_if<!is_constructible< _Tp,
_ValueType && >::value, bool >::type = false>
std::experimental::any::any (_ValueType && __value) [inline]
Constructs the contained object from a copy of __value, with the opposite enable-if setup π«Ά.
std::experimental::any::~any () [inline]
Destructor, calls clear(). References: clear().
Member Function Documentation π
void std::experimental::any::clear () [inline], [noexcept]
If itβs 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().
Templated std::experimental::any::operator= β the _ValueType && __rhs version [inline]
Exact signature:
template<typename _ValueType > enable_if_t<!is_same< any, decay_t<
_ValueType > >::value, any & > std::experimental::any::operator=
(_ValueType && __rhs) [inline]
Stores a copy of __rhs as the contained object. References: any().
any & std::experimental::any::operator= (any && __rhs) [inline], [noexcept]
Move assignment operator.
Postcondition: __rhs.empty() (not guaranteed for other implementations) π
References: clear().
any & std::experimental::any::operator= (const any & __rhs) [inline]
Copies the state of another object. References: any().
void std::experimental::any::swap (any & __rhs) [inline], [noexcept]
Exchanges state with another object. References: empty().
const type_info & std::experimental::any::type () const [inline], [noexcept]
The typeid of the contained object, or typeid(void) if empty. References: empty().
Author π
Generated automatically by Doxygen for libstdc++ from the source code.
Okay bestie, thatβs the whole page π source/version: libstdc++; page id: std::experimental::any(3cxx); date: the original footer didnβt print one, so no timestamp to hand you β lowkey tragic π. Bye π«Ά
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms