title: Strange Compiler Behavior Regarding Default Constructors in C++
body: <pre><code>class TestClass
  {
  public:
      TestClass(int i) { i = i; };
  private:
      int i;
  }
  
  class TestClass2
  {
  private:
      TestClass testClass;
  }
  </code></pre>
  
  <p>Why does the above code compile fine even when we have not provided a default constructor?</p>
  
  <p>Only if someone instantiates TestClass2 elsewhere in the code, do we get a compile error. What is the compiler doing here? Seems strange...</p>
  
  <p>Thanks.</p>