Skip to content

Instantly share code, notes, and snippets.

Last active September 8, 2017 11:13
What would you like to do?
template<typename Derived>
struct Clonable
virtual ~Clonable() = default;
std::unique_ptr<Derived> clone()
return std::unique_ptr<Derived>(cloneImpl());
virtual Derived* cloneImpl() const = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment