15 #ifndef ALLIUM_UTIL_CLONEABLE_HPP
16 #define ALLIUM_UTIL_CLONEABLE_HPP
20 #include <allium/util/assert.hpp>
38 std::enable_if_t<std::is_base_of<Cloneable, T>::value,
40 friend clone(
const T& o);
44 std::enable_if_t<std::is_base_of<Cloneable, T>::value,
51 dynamic_cast<T*
>(ptr) !=
nullptr,
52 std::string(
"The clone method is not overridden in ")
56 return std::unique_ptr<T>(
static_cast<T*
>(ptr));
A class that allows cloning of objects.
Definition: cloneable.hpp:30