My previous article talking about dependency injection had the dependencies registered via an explicit function called from main. This may give the wrong Idea about how to register dependencies. Here is a much better approach, but with a solution that is compiler specific.
Initializing Dependencies in g++
Reply