0

I have a inheritance hierarchy that looks like this:

class Y { ... };

/* ================================================== */

class A
{
    public:
    A(ACfg* cfg);
};

class ACfg { ... };

/* ================================================== */

class B: virtual public A
{
    public:
    B(ACfg* cfg): A(cfg)
    {}
};

/* ================================================== */

class C: virtual public A
{
    public:
    C(ACfg* cfg): A(cfg) {}
};

/* ================================================== */

template<typename T> class D<T>: public B
{
public: 
    D(ACfg* cfg);
private:    
    T member;
};

template<typename T>
D<T>::D(ACfg* cfg): B(cfg) {}

/* ================================================== */

class E: public C, public D<Y>
{
    E(ACfg* cfg): 
        C(cfg), D<Y>(cfg) {}
                          ^
};

/* ================================================== */

class F: public E
{
    F(ACfg* cfg): E(cfg) {} 
                         ^
};

Class template D and its constructor implementation are both in the same header file.

In the with "^" marked places I get the compiler error: "no default constructor exists for class "A""

Now why would it need that one at all? Do I have to explicitly instantiate the D at some point?

What is my mistake?

In advance I want to thank you for all your help.

0 Answers0