Classes |
struct | requires_allocation |
| Whether the type T must be dynamically allocated or can be stored on the stack. More...
|
union | storage_union |
struct | vtable_dynamic |
| VTable for dynamically allocated storage. More...
|
struct | vtable_stack |
| VTable for stack allocated storage. More...
|
struct | vtable_type |
| Base VTable specification. More...
|
Public Member Functions |
| any () |
| Constructs an object of type any with an empty state.
|
| any (const any &rhs) |
| Constructs an object of type any with an equivalent state as other.
|
| any (any &&rhs) noexcept |
template<typename ValueType , typename = typename std::enable_if<!std::is_same< typename std::decay<ValueType>::type, any>::value>::type> |
| any (ValueType &&value) |
void | clear () noexcept |
| If not empty, destroys the contained object.
|
bool | empty () const noexcept |
| Returns true if *this has no contained object, otherwise false.
|
any & | operator= (const any &rhs) |
| Has the same effect as any(rhs).swap(*this). No effects if an exception is thrown.
|
any & | operator= (any &&rhs) noexcept |
template<typename ValueType , typename = typename std::enable_if<!std::is_same< typename std::decay<ValueType>::type, any>::value>::type> |
any & | operator= (ValueType &&value) |
void | swap (any &rhs) noexcept |
| Exchange the states of *this and rhs.
|
const std::type_info & | type () const noexcept |
| If *this has a contained object of type T, typeid(T); otherwise typeid(void).
|
| ~any () |
| Same effect as this->clear().
|
Protected Member Functions |
template<typename T > |
const T * | cast () const noexcept |
| Casts (with no type_info checks) the storage pointer as const T*.
|
template<typename T > |
T * | cast () noexcept |
| Casts (with no type_info checks) the storage pointer as T*.
|
bool | is_typed (const std::type_info &t) const |
| Same effect as is_same(this->type(), t);.
|
Static Protected Member Functions |
static bool | is_same (const std::type_info &a, const std::type_info &b) |
Private Member Functions |
template<typename ValueType > |
void | construct (ValueType &&value) |
template<typename ValueType , typename T > |
std::enable_if
< requires_allocation< T >
::value >::type | do_construct (ValueType &&value) |
template<typename ValueType , typename T > |
std::enable_if
<!requires_allocation< T >
::value >::type | do_construct (ValueType &&value) |
Static Private Member Functions |
template<typename T > |
static vtable_type * | vtable_for_type () |
| Returns the pointer to the vtable of the type T.
|
Private Attributes |
storage_union | storage |
vtable_type * | vtable |
Friends |
template<typename T > |
const T * | any_cast (const any *operand) noexcept |
template<typename T > |
T * | any_cast (any *operand) noexcept |
Definition at line 34 of file any.hpp.
template<typename ValueType , typename = typename std::enable_if<!std::is_same< typename std::decay<ValueType>::type, any>::value>::type>
Constructs an object of type any that contains an object of type T direct-initialized with std::forward<ValueType>(value).
T shall satisfy the CopyConstructible requirements, otherwise the program is ill-formed. This is because an `any` may be copy constructed into another `any` at any time, so a copy should always be allowed.
Definition at line 74 of file any.hpp.
template<typename ValueType , typename = typename std::enable_if<!std::is_same< typename std::decay<ValueType>::type, any>::value>::type>
any& linb::final::operator= |
( |
ValueType && |
value | ) |
[inline] |
Has the same effect as any(std::forward<ValueType>(value)).swap(*this). No effect if a exception is thrown.
T shall satisfy the CopyConstructible requirements, otherwise the program is ill-formed. This is because an `any` may be copy constructed into another `any` at any time, so a copy should always be allowed.
Definition at line 104 of file any.hpp.