Doug Harrison [MVP] wrote:[color=blue]
> Edward Diener wrote:
>[color=green]
>> Doug Harrison [MVP] wrote:[color=darkred]
>>> Edward Diener wrote:
>>>> But even in the nested class situation,
>>>> a nested class does not have access to the private or protected
>>>> members of its surrounding class. Unless the rules have changed
>>>> drastically somehow.
>>>
>>> The rules which didn't give access to nested or local classes were
>>> never very helpful. Like I said in my first reply:
>>>
>>> It seems like most of my pImpl classes don't need to be friends of
>>> their "host" classes, but in any event, it shouldn't be necessary to
>>> make the pImpl class a friend for it to have full access to the host
>>> class. ISTR that VC7 tracks this DR:
>>>
>>>
http://www.comeaucomputing.com/iso/cwg_defects.html#45
>>>
>>> Try the example I gave you. It compiles with VC 7.1 and Comeau, but
>>> not VC6.[/color]
>>
>> I am trying to understand why it compiles. Have the rules regarding
>> access by members of a nested class to the protected and private
>> members and types of its enclosing class changed ? Because that is
>> clearly what you are doing in the example. So when it compiles
>> successfully in VC7.1 and Comeau, it appears that neither are
>> following the C++ Standard. Surely there is something I am missing
>> here. Have the rules changed for these compilers from the 1998 C++
>> Standard ?[/color]
>
> The code I presented is illegal by the original rules, but legal
> under the resolution of the defect report I pointed you to. This DR
> has "WP" status, which means:
>
> "WP: A DR issue that the Committee has voted to apply to the current
> Working Paper. The Working Paper is a draft for a future version of
> the Standard."
>
> To "track this DR" is to implement the changes it proposes.[/color]
Ok, now I realize the full impact of the DR and what is meant by tracking
it. That is a big change to C++. I never realized that this had been
proposed and accepted in the Working Paper. Thanks !