Dependency Injection tool for c++
I don't think that makes it easier (or cleaner)
You are injecting pointers (which begs to ask ownership)
You should be preferring encapsulation over inheritance.


If I was doing it normally:

class component
{
    Scene&amp;   scene;
    Entity&amp;  entity;
    Foo&amp;     foo;
    public:
    component(Scene&amp; s, Entity&amp; e, Foo&amp; f)
        : scene(s)
        , entity(e)
        , foo(f)
    {}
    virtual ~component(){};

    void method()
    {
        scene-&gt;method();
        foo-&gt;method();
    }
};

int main()
{
    scene s;
    entity e;
    foo f;
    component c(s, e, f});

    c.method();
}


This seems much cleaner than your method (where you introduce another level of inheritance).