std::experimental::any(3)

NAME
std::experimental::any - A type-safe container of any type.

SYNOPSIS

  Public Member Functions
any () noexcept
Default constructor, creates an empty object.
any (const any &__other)
Copy constructor, copies the state of __other.
any (any &&__other) noexcept
Move constructor, transfer the state from __other.
template<typename _ValueType , typename _Tp = _Decay<_ValueType>, typename _Mgr = _Manager<_Tp>> any (_ValueType &&__value)
Construct with a copy of __value as the contained object.
~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.
any & operator= (const any &__rhs)
Copy the state of another object.
any & operator= (any &&__rhs) noexcept
Move assignment operator.
template<typename _ValueType > enable_if_t<!is_same< any, decay_t< _ValueType > >::value, any & > operator= (_ValueType &&__rhs)
Store a copy of __rhs as the contained 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<typename _Tp > static constexpr bool __is_valid_cast ()

  Friends
template<typename _Tp > 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.

Definition at line 88 of file any.

Constructor & Destructor Documentation

  std::experimental::any::any () [inline], [noexcept]

Default constructor, creates an empty object.

Definition at line 127 of file any.

  std::experimental::any::any (const any & __other) [inline]

Copy constructor, copies the state of __other.

Definition at line 130 of file any.

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)

Definition at line 147 of file any.

  template<typename _ValueType , typename _Tp = _Decay<_ValueType>, typename _Mgr = _Manager<_Tp>> std::experimental::any::any (_ValueType && __value) [inline]

Construct with a copy of __value as the contained object.

Definition at line 162 of file any.

  std::experimental::any::~any () [inline]

Destructor, calls clear()

Definition at line 171 of file any.

Member Function Documentation

  void std::experimental::any::clear () [inline], [noexcept]

If not empty, destroy the contained object.

Definition at line 223 of file any.

  bool std::experimental::any::empty () const [inline], [noexcept]

Reports whether there is a contained object or not.

Definition at line 265 of file any.

Referenced by any(), and operator=().

  any& std::experimental::any::operator= (const any & __rhs) [inline]

Copy the state of another object.

Definition at line 176 of file any.

References empty().

  any& std::experimental::any::operator= (any && __rhs) [inline], [noexcept]

Move assignment operator.

Postcondition:
    __rhs.empty() (not guaranteed for other implementations)

Definition at line 196 of file any.

  template<typename _ValueType > enable_if_t<!is_same<any, decay_t<_ValueType> >::value, any&> std::experimental::any::operator= (_ValueType && __rhs) [inline]

Store a copy of __rhs as the contained object.

Definition at line 214 of file any.

  void std::experimental::any::swap (any & __rhs) [inline], [noexcept]

Exchange state with another object.

Definition at line 233 of file any.

  const type_info& std::experimental::any::type () const [inline], [noexcept]

The typeid of the contained object, or typeid(void) if empty.

Definition at line 269 of file any.

Author

Generated automatically by Doxygen for libstdc++ from the source code.