title: Is dependency injection useful in C++
body: <p>C# uses <em><strong>Dependency Injection (DI)</strong></em> a lot to have a <em><strong>lossless</strong></em> and <em><strong>testable</strong></em> platform. For this, I need an <strong><code>interface</code></strong> and maybe a <strong>DI</strong> or <strong>Inversion of Control (IoC) container</strong> for resolving my instances.</p>
  
  <p><strong>But how do you do this in C++?</strong>  I've read a little bit about this, and it seems that dependency injection in C++ isn't as big a topic as in C#. In C++ you use a <em>reference to an object</em> - this is the way to use DI in C++, right? </p>
  
  <p>If my theory with references are correct, is there something like a container where I can resolve all the references? In C# I have a <strong><code>"bad class/bad project/assembly"</code></strong> which registers all my instances into a static container at the program start. Then, in every class, I'm able to instance the static container and can resolving a specific instance, is this possible in C++?</p>
  
  <p><strong>Are you using Dependency Injection (or whatever it is called) in C++? If yes, how you're use it? Are there similarities to C#?</strong></p>