3 ms·
The base class must be a template with one parameter being the derived class: template <typename D> class Base { ... }; and then: class Derived:
by Kristine1975 10y ago
The base class must be a template with one parameter being the derived class:
template <typename D>
class Base {
...
};
and then:
class Derived: public Base<Derived> {
...
};
This is called the https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern https://en.wikipedia.org/wiki/Curiously_recurring_template_p...