9#ifndef LLDB_UTILITY_CLONEABLE_H
10#define LLDB_UTILITY_CLONEABLE_H
39template <
typename Derived,
typename Base>
44 std::shared_ptr<typename Base::TopmostBase>
Clone()
const override {
47 static_assert(std::is_base_of<Cloneable, Derived>::value,
48 "Derived class must be derived from this.");
50 return std::make_shared<Derived>(
static_cast<const Derived &
>(*
this));
A class that implements CRTP-based "virtual constructor" idiom.
std::shared_ptr< typename Base::TopmostBase > Clone() const override
A class that represents a running process on the host machine.