1.1.0
CCC
 
ICloneable.hpp File Reference
#include "gstlearn_export.hpp"
#include <typeinfo>
#include <assert.h>

Classes

class  ICloneable
 

Macros

#define IMPLEMENT_CLONING(Class)
 

Macro Definition Documentation

#define IMPLEMENT_CLONING (   Class)
Value:
public: \
inline virtual Class* clone() const override \
{ \
static_assert( \
! std::is_abstract<Class>::value, \
"Class cannot be cloned as it is abstract" \
); \
assert(typeid(*this) == typeid(Class)); \
return (new Class(*this)); \
}