1.3.1
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

◆ IMPLEMENT_CLONING

#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)); \
}