c++ order of defs in the class, surprise
<p>Stroustrup states in C++ Language book that order of definitions in the class does not matter.<br>
Indeed:</p>

<pre><code>class C1 { 
       int foo() { return bar(); }    // where is bar() ?
       int bar() { return m_count; }  // oh, here is bar(). but where is m_count ?
       int m_count;                   // here is m_count. Better late than never !
}
</code></pre>

<p>This compiles. Despite misordering. As promised. 
So far, so good.</p>

<p>However, this does not compile:</p>

<pre><code>class C2 {
      void baz(Inner *p) {} // we were promised that order does not matter
                            // is Inner defined ?
      struct Inner {};      // yes, Inner is define here.
};
</code></pre>

<p>This looks a contradiction to Stroustrup's promise of free ordering inside the class. Quoting Stroustrup: "A member function declared within a class can refer to every member of the class as if the class were completely defined before the member function bodies were considered".</p>

<p>Does anybody know a ref to standard clause that allows C1 and disallows C2 ? I am curious why C2 was disallowed while C1 is allowed. Is it compiler bug that contradicts the standard, maybe ?</p>
