<in*****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Greg wrote: Andre Eisenbach wrote: Should this code compile or not?
No, the code should not compile. ...
... A function declared as a friend must be accessible to the
class making the declaration.
Is there any part of the C++ standard or any other documentation that
backs up this statement?
11.1
1 A member of a class can be
- private; that is, its name can be used only by members and friends of the
class in which it is declared.
- protected; ...
....
4 Access control is applied uniformly to all names, whether the names are
referred to from declarations or
expressions. [Note: access control applies to names nominated by friend
declarations (11.4) and using declarations (7.3.3). ]
Sorry for my mistaken earlier post. I thought you were only asking if
nominating a class member function as a friend is allowed. The private
member access didn't register with me before or after VC++ 6.0 happily
compiled it
DW