title: Nested Class Definition in source file
body: <p>If I have a nested class like so:</p>
  
  <pre><code>  class MyClass
    {
      class NestedClass
      {
      public:
        // nested class members AND definitions here
      };
  
      // main class members here
    };
  </code></pre>
  
  <p>Currently, the definitions of <code>MyClass</code> are in the <code>CPP</code> file but the definitions for <code>NestedClass</code> are in the header file, that is, I cannot declare the functions/constructors in the <code>CPP</code> file. </p>
  
  <p>So my question is, how do I define the functions of <code>NestedClass</code> in the cpp file? If I cannot, what is the reason (and if this is the case, I have a vague idea of why this happens but I would like a good explanation)? What about structures?</p>