title: Why is there an injected class name?
body: <p>Recently, I saw a strange C++ feature: <em>injected class name</em>.</p>
  
  <pre><code>class X { };
  X x1;
  class X::X x2; // class X::X is equal to X
  class X::X::X x3; // ...and so on...
  </code></pre>
  
  <p>But I cannot figure out why this feature is necessary. Is there any practice that requires this feature?</p>
  
  <p>And I heard this feature didn't exist in old C++. Then, when was it introduced? C++03? C++11?</p>