I would like to know the C++ equivalent of the following Java code.
public Class MyClass <T extends MyClass<T>> {...}
I have tried the following but failed using C11:
template <class T> class Parent {
static_assert(std::is_base_of<Parent<T>, T>::value);
public:
T* next;
};
class Child: public Parent<Child> {
public:
Child* next;
};
Which results in:
incomplete type `Child` used in type trait expressions