58 TIMEMORY_DEFAULT_OBJECT(
copy)
60 copy(Tp& obj, const Tp& rhs) { (*this)(obj, rhs); }
61 copy(Tp*& obj,
const Tp* rhs) { (*this)(obj, rhs); }
62 copy(Tp*& obj,
const std::shared_ptr<Tp>& rhs) { (*this)(obj, rhs.get()); }
63 copy(Tp*& obj,
const std::unique_ptr<Tp>& rhs) { (*this)(obj, rhs.get()); }
65 template <
typename Up = Tp>
68 return sfinae(obj, std::forward<Up>(v));
71 template <
typename Up = Tp>
74 return sfinae(obj, std::forward<Up>(v));
78 template <
typename Up,
typename Dp = decay_t<Up>>
79 TIMEMORY_INLINE Tp& sfinae(Tp& obj, Up&& rhs,
84 template <
typename Up,
typename Dp = decay_t<Up>>
85 TIMEMORY_INLINE Tp* sfinae(
90 template <
typename Up,
typename Dp = decay_t<Up>>
91 TIMEMORY_INLINE
auto sfinae(
95 template <
typename Up,
typename Dp = decay_t<Up>>
96 TIMEMORY_INLINE
auto sfinae(
101template <
typename Tp>
102template <
typename Up,
typename Dp>
106 enable_if_t<trait::is_available<Dp>::value && !std::is_pointer<decay_t<Dp>>::value,
109 obj = Up{ std::forward<Up>(rhs) };
110 operation::set_iterator<Tp>{}(obj,
nullptr);
114template <
typename Tp>
115template <
typename Up,
typename Dp>
119 enable_if_t<trait::is_available<Dp>::value && std::is_pointer<decay_t<Dp>>::value,
126 obj =
new type{ *std::forward<Up>(rhs) };
130 *obj = type{ *std::forward<Up>(rhs) };
132 operation::set_iterator<Tp>{}(*obj,
nullptr);
typename std::decay< T >::type decay_t
Alias template for decay.
typename std::enable_if< B, T >::type enable_if_t
Alias template for enable_if.
The declaration for the types for operations without definitions.
Include the macros for operations.
Declare the operations types.
This operation class is used for copying the object generically.
copy(Tp *&obj, const Tp *rhs)
auto operator()(Tp *&obj, Up &&v) const
copy(Tp *&obj, const std::unique_ptr< Tp > &rhs)
auto operator()(Tp &obj, Up &&v) const
copy(Tp *&obj, const std::shared_ptr< Tp > &rhs)
trait that signifies that an implementation for the component is available. When this is set to false...