|
|
| any () noexcept |
| | Constructs an any instance that does not contain any value.
|
| |
| | any (any &&other) noexcept |
| | Moves an any instance by moving the stored underlying value. More...
|
| |
| | any (const any &other) |
| | Copies an any instance by copying the stored underlying value. More...
|
| |
| template<typename ValueType , typename = enable_if_t<!is_same<decay_t<ValueType>,any>::value && is_copy_constructible<decay_t<ValueType>>::value>> |
| | any (ValueType &&value) |
| | Constructs this any using value for the underlying instance. More...
|
| |
| template<typename ValueType , typename... Args, typename = enable_if_t<is_constructible<decay_t<ValueType>,Args...>::value && is_copy_constructible<decay_t<ValueType>>::value>> |
| | any (in_place_type_t< ValueType >, Args &&...args) |
| | Constructs an 'any' of type ValueType by forwarding args to its constructor. More...
|
| |
| template<typename ValueType , typename U , typename... Args, typename = enable_if_t<is_constructible<decay_t<ValueType>,std::initializer_list<U>,Args...>::value && is_copy_constructible<decay_t<ValueType>>::value>> |
| | any (in_place_type_t< ValueType >, std::initializer_list< U > il, Args &&...args) |
| | Constructs an 'any' of type ValueType by forwarding args to its constructor. More...
|
| |
| any & | operator= (any &&other) noexcept |
| | Assigns the contents of other to this any. More...
|
| |
| any & | operator= (const any &other) |
| | Assigns the contents of other to this any. More...
|
| |
| template<typename ValueType , typename = enable_if_t<!is_same<decay_t<ValueType>,any>::value && is_copy_constructible<decay_t<ValueType>>::value>> |
| any & | operator= (ValueType &&value) |
| | Assigns value to this any. More...
|
| |
|
void | reset () noexcept |
| | Destroys the underlying stored value, leaving this any empty.
|
| |
| void | swap (any &other) noexcept |
| | Swaps the contents of this with other. More...
|
| |
| bool | has_value () const noexcept |
| | Checks whether this any contains a value. More...
|
| |
| const std::type_info & | type () const noexcept |
| | Gets the type_info for the underlying stored type, or typeid(void) if has_value() returns false. More...
|
| |
|
template<typename ValueType , typename > |
| BPSTD_INLINE_VISIBILITY | any (ValueType &&value) |
| |
|
template<typename ValueType , typename... Args, typename > |
| BPSTD_INLINE_VISIBILITY | any (in_place_type_t< ValueType >, Args &&...args) |
| |
|
template<typename ValueType , typename U , typename... Args, typename > |
| BPSTD_INLINE_VISIBILITY | any (in_place_type_t< ValueType >, std::initializer_list< U > il, Args &&...args) |
| |
|
template<typename ValueType , typename > |
| BPSTD_INLINE_VISIBILITY bpstd::any & | operator= (ValueType &&value) |
| |
|
template<typename ValueType , typename... Args, typename > |
| BPSTD_INLINE_VISIBILITY bpstd::decay_t< ValueType > & | emplace (Args &&...args) |
| |
|
template<typename ValueType , typename U , typename... Args, typename > |
| BPSTD_INLINE_VISIBILITY bpstd::decay_t< ValueType > & | emplace (std::initializer_list< U > il, Args &&...args) |
| |
|
| template<typename ValueType , typename... Args, typename = enable_if_t<is_constructible<decay_t<ValueType>,Args...>::value && is_copy_constructible<decay_t<ValueType>>::value>> |
| decay_t< ValueType > & | emplace (Args &&...args) |
| | Emplaces a ValueType into this any, destroying the previous value if it contained one. More...
|
| |
| template<typename ValueType , typename U , typename... Args, typename = enable_if_t<is_constructible<decay_t<ValueType>,std::initializer_list<U>,Args...>::value && is_copy_constructible<decay_t<ValueType>>::value>> |
| decay_t< ValueType > & | emplace (std::initializer_list< U > il, Args &&...args) |
| | Emplaces a ValueType into this any, destroying the previous value if it contained one. More...
|
| |
An object that can hold values of any type via type-erasure.
The class any describes a type-safe container for single values of any type.
1) An object of class any stores an instance of any type that satisfies the constructor requirements or is empty, and this is referred to as the state of the class any object. The stored instance is called the contained object. Two states are equivalent if they are either both empty or if both are not empty and if the contained objects are equivalent.
2) The non-member any_cast functions provide type-safe access to the contained object.
This implementation uses small-buffer optimization to avoid dynamic memory if the object is below a (4 * sizeof(void*))
Definition at line 84 of file any.hpp.