问一个c++primer上的有关问题

问一个c++primer上的问题
看c++primer时读到一句话 ——

p800页关于nested class的,
listitem is not permitted to access a private data member of its enclosing class, such as list.

意思是说,内部类不能访问外部类的私有成员,但我自己做了实验,内部类是可以访问外部类的私有成员的..

求解释.

------解决方案--------------------
上代码!好像我没有办法访问。
------解决方案--------------------
LZ,出现灵异事件了。。。8 可能的事情呀( ⊙ o ⊙ )!
------解决方案--------------------
你的代码和 c++primer 都是正确的,问题的原因在于新版 C++ 标准对此有了不同的规定,具体见:
c++03 11.8/1
The members of a nested class have no special access to members of an enclosing class, nor to classes or functions that have granted friendship to an enclosing class; the usual access rules (clause 11) shall be obeyed. The members of an enclosing class have no special access to members of a nested class; the usual
access rules (clause 11) shall be obeyed.

c++11 11.7/1
A nested class is a member and as such has the same access rights as any other member. The members of an enclosing class have no special access to members of a nested class; the usual access rules (Clause 11) shall be obeyed.

根据 c++11 11.7/1,你的代码是合法的。根据 c++03 11.8/1 和 c++ primer 成书的年代,Lippman 也是正确的。