#include "gstlearn_export.hpp"
#include <typeinfo>
#include <assert.h>
◆ 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)); \
}