When you have an inheritance situation like this, under normal circumstances, because D is inheriting from both B and C and because A is at the top of the diamond shape, D will get 2 copies of the members and variables within A. This can be avoided by applying the virtual keyword:

virtual ~Animal() = default;
    virtual void Eat() {}
};

// Two classes virtually inheriting Animal:
struct Mammal: virtual Animal {
    virtual void Breathe() {}
};

struct WingedAnimal: virtual Animal {
    virtual void Flap() {}
};

// A bat is still a winged mammal
struct Bat: Mammal, WingedAnimal {};

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/58b8d99c-925d-493c-a3fa-3d85143f1162/Untitled.png

Virtual inheritance

C++ For C# Developers: Part 14 - Inheritance - JacksonDunstan.com