Dependency Injection in C++ Using Variadic Templates
gpfault.net
gpfault.net
there is an advantage of knowing things at compile time with the template, but i'm not sure that performance benefit is going to be worth very much here.
there is also the advantage that you don't need an instanced class with a vtable, but can use something with no inheritance or even with completely static member functions and data as a dependency as well... this might be more useful.
I don't see what is wrong with the 'boring' way of dependency injection. If a class relies on another class, pass it in the constructor explicitly. It's simple and easy to follow the stack back to find problems.