Group: comp.lang.c++
From: Adrian
Date: Friday, February 15, 2008 3:00 PM
Subject: Re: Quick friend question

On Feb 15, 1:40 pm, James Kanze wrote:
> It depends. Both declare exactly the same function, with
> exactly the same linkage. But in the second case, the scope of
> the declaration is the class, and it will only be found when the
> compiler does a name lookup which includes the class (either
> because it is from a class member function, or due to ADL).

But 11.4.1 says a friend cannot be in the scope of a class for name
looks if I am reading this correctly

"11.4.1 A friend of a class is a function or class that is not a
member of the class but is permitted to use the private and protected
member names from the class. The name of a friend is not in the scope
of the class, and the friend is not called with the member access
operators (5.2.5) unless it is a member of another class. [Example:
the following example illustrates the differences between members and
friends:"


Adrian

Safety Articles | Usenet Groups | Usenet News | Bluegrass