如何在C ++模板中调用类的构造函数?

考虑一个C ++模板类(mixin类),该类继承自模板上声明的同一类,即

template <class Model>
class Mixin : public Model {
  ...
}

The motivation is to reuse this Mixin to extend methods for different Model classes. For example, for a model class ModelOne,

class Realization : public Mix<ModelOne> {
...
}

How do I explicitly invoke - in Realization class - the constructor of ModelOne class? Different model class may have different constructor signature.

评论