a in-class class access the outer class's data member
<p>I was trying to do this,</p>

<pre><code>class Outer {
public:
    struct inner_t {
        void foo()
        {
            printf("%d", _x);
        }
    };
    int _x;
};

int main()
{
    Outer o;
    o._x = 10;
}
</code></pre>

<p>The above can't compile with errors:</p>

<blockquote>
  <p>error: invalid use of non-static data member ‘Outer::_x’</p>
</blockquote>

<p>But according to <a href="http://stackoverflow.com/a/8870002/888051">this post</a>, <code>inner_t</code> can indeed access <code>Outer::_x</code>, what's wrong?</p>
