Non Intrusive Static Recursive Dependency Injection for C++14
github.com
github.com
Here is my version: http://bitbucket.org/cheez/dicpp
With the following caveats:
* It is not very cool
* It works really well for my uses
* It is not as efficient as the compile-time ones
WRT efficiency, 99% of DI is done at application startup and you can easily make that efficient enough by delaying instantiations until you actually need them. The bottleneck at startup so far has never been the library itself.I continue to look for one that allows me to create compiler firewalls so I can use it instead of my own.
Alternatively, if someone wants to give me tips to avoid the hideous DI_CONSTRUCTOR (see https://bitbucket.org/cheez/dicpp/src/HEAD/lib/examples/stoc...) I'm all ears.
There was one posted on the Boost list not so long ago which was VERY promising but I haven't managed to get around to using it yet.
So I think a different convention (Name_, _name, etc.) would be better to use in example code, so that people don't learn a convention that might byte them down the road.
Obviously the trivial form of dependency injection (just pass a parameter manually) requires no special library.