6 #ifndef IROHA_CLONEABLE_HPP 7 #define IROHA_CLONEABLE_HPP 42 std::unique_ptr<T>
clone(
const T &
object) {
44 static_assert(std::is_base_of<base_type, T>::value,
45 "T object has to derived from T::base_type");
47 return std::unique_ptr<T>(
static_cast<T *
>(ptr));
58 return clone(*
object);
78 virtual T *
clone()
const = 0;
81 friend std::unique_ptr<X>
clone(
const X &);
84 #endif // IROHA_CLONEABLE_HPP T base_type
Definition: cloneable.hpp:68
Definition: cloneable.hpp:33
std::unique_ptr< T > clone(const T &object)
Definition: cloneable.hpp:42
virtual T * clone() const =0
virtual ~Cloneable()=default