3 ms·
My favourite topic! I am glad that people are still thinking about automated DI in C++. I am sure the new standards make a lot of things easier. This library lo
by cheez 12y ago
My favourite topic! I am glad that people are still thinking about automated DI in C++. I am sure the new standards make a lot of things easier. This library looks like a cool experiment and I hope the author continues to move in this direction.
Here is my version: http://bitbucket.org/cheez/dicpp 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/stockquote/StockQuoteApp.hpp#cl-15 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.