Nymph Game Engine
Chaiscript based Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cloneable.hpp
Go to the documentation of this file.
1 #ifndef CLONEABLE_H
2 #define CLONEABLE_H
3 #include <memory>
4 
5 template<class CloneType>
6 class Cloneable {
7  public:
8  virtual ~Cloneable() {}
9  std::shared_ptr<CloneType> clone() {
10  return std::shared_ptr<CloneType>(new CloneType(*dynamic_cast<CloneType*>(this)));
11  }
12 };
13 #endif
virtual ~Cloneable()
Definition: cloneable.hpp:8
Definition: cloneable.hpp:6
std::shared_ptr< CloneType > clone()
Definition: cloneable.hpp:9