libstdc++

std::experimental::fundamentals_v1::any Class Reference

A type-safe container of any type. More...

List of all members.

Public Member Functions

 any () noexcept
 any (const any &__other)
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)
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)
 any (any &&__other) noexcept
 ~any ()
void clear () noexcept
bool empty () const noexcept
anyoperator= (const any &__rhs)
anyoperator= (any &&__rhs) noexcept
template<typename _ValueType >
enable_if_t<!is_same< any,
decay_t< _ValueType > >::value,
any & > 
operator= (_ValueType &&__rhs)
void swap (any &__rhs) noexcept
const type_infotype () const noexcept

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 89 of file any.


Constructor & Destructor Documentation

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

Default constructor, creates an empty object.

Definition at line 128 of file any.

Referenced by operator=().

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

Copy constructor, copies the state of __other.

Definition at line 131 of file any.

References empty().

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

Move constructor, transfer the state from __other.

Postcondition:
__other.empty() (this postcondition is a GNU extension)

Definition at line 148 of file any.

template<typename _ValueType , typename _Tp = _Decay<_ValueType>, typename _Mgr = _Manager<_Tp>, typename enable_if< is_constructible< _Tp, _ValueType && >::value, bool >::type = true>
std::experimental::fundamentals_v1::any::any ( _ValueType &&  __value) [inline]

Construct with a copy of __value as the contained object.

Definition at line 165 of file any.

template<typename _ValueType , typename _Tp = _Decay<_ValueType>, typename _Mgr = _Manager<_Tp>, typename enable_if<!is_constructible< _Tp, _ValueType && >::value, bool >::type = false>
std::experimental::fundamentals_v1::any::any ( _ValueType &&  __value) [inline]

Construct with a copy of __value as the contained object.

Definition at line 178 of file any.

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

Destructor, calls clear()

Definition at line 187 of file any.

References clear().


Member Function Documentation

void std::experimental::fundamentals_v1::any::clear ( ) [inline]

If not empty, destroy the contained object.

Definition at line 239 of file any.

References empty().

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

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

Reports whether there is a contained object or not.

Definition at line 281 of file any.

Referenced by any(), clear(), operator=(), swap(), and type().

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

Move assignment operator.

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

Definition at line 212 of file any.

References clear(), and empty().

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

Copy the state of another object.

Definition at line 192 of file any.

References clear(), and empty().

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

Store a copy of __rhs as the contained object.

Definition at line 230 of file any.

References any().

void std::experimental::fundamentals_v1::any::swap ( any __rhs) [inline]

Exchange state with another object.

Definition at line 249 of file any.

References empty().

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

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

Definition at line 285 of file any.

References empty().


The documentation for this class was generated from the following file: