|
| constexpr | 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 T, typename V = decay_if_not_any<T>, typename Mgr = Manager<V>, std::enable_if_t< std::is_copy_constructible_v< V > &&!is_in_place_type_v< V >, bool > = true> |
| | any (T &&value) |
| | Construct with a copy of value as the contained object.
|
| |
| template<typename T, typename... Args, typename V = std::decay_t<T>, typename Mgr = Manager<V>, any_constructible_t< V, Args &&... > = false> |
| | any (std::in_place_type_t< T >, Args &&... args) |
| | Construct with an object created from args as the contained object.
|
| |
| template<typename T, typename U, typename... Args, typename V = std::decay_t<T>, typename Mgr = Manager<V>, any_constructible_t< V, std::initializer_list< U > &, Args &&... > = false> |
| | any (std::in_place_type_t< T >, std::initializer_list< U > il, Args &&... args) |
| | Construct with an object created from il and args as the contained object.
|
| |
| | ~any () |
| | Destructor, calls reset().
|
| |
| any & | operator= (const any &rhs) |
| | Copy the state of another object.
|
| |
| any & | operator= (any &&rhs) noexcept |
| | Move assignment operator.
|
| |
| template<typename T> |
| std::enable_if_t< std::is_copy_constructible_v< decay_if_not_any< T > >, any & > | operator= (T &&rhs) |
| | Store a copy of rhs as the contained object.
|
| |
| template<typename T, typename... Args> |
| any_emplace_t< std::decay_t< T >, Args... > | emplace (Args &&... args) |
| | Emplace with an object created from args as the contained object.
|
| |
| template<typename T, typename U, typename... Args> |
| any_emplace_t< std::decay_t< T >, std::initializer_list< U > &, Args &&... > | emplace (std::initializer_list< U > il, Args &&... args) |
| | Emplace with an object created from il and args as the contained object.
|
| |
| void | reset () noexcept |
| | If not empty, destroys the contained object.
|
| |
| void | swap (any &rhs) noexcept |
| | Exchange state with another object.
|
| |
| bool | has_value () const noexcept |
| | Report whether there is a contained object or not.
|
| |
| const std::type_info & | type () const noexcept |
| | The typeid of the contained object, or typeid(void) if empty.
|
| |
|
| enum | Op {
Op_Access
, Op_Get_Type_Info
, Op_Clone
, Op_Destroy
,
Op_Xfer
} |
| |
| template<typename T, bool Safe = std::is_nothrow_move_constructible_v<T>, bool Fits = ( sizeof( T ) <= sizeof( Storage ) ) && ( alignof( T ) <= alignof( Storage ) )> |
| using | Use_Internal_Storage = std::integral_constant<bool, Safe && Fits> |
| |
| template<typename T> |
| using | Manager |
| |
| template<typename T, typename V = std::decay_t<T>> |
| using | decay_if_not_any = std::enable_if_t<!std::is_same_v<V, any>, V> |
| |
| template<typename Res, typename T, typename... Args> |
| using | any_constructible |
| |
| template<typename T, typename... Args> |
| using | any_constructible_t = typename any_constructible<bool, T, Args...>::type |
| |
| template<typename V, typename... Args> |
| using | any_emplace_t = typename any_constructible<V&, V, Args...>::type |
| |
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 92 of file ki_any.h.