Topic: scope of friend identifiers
Author: rfg@NCD.COM (Ron Guilmette)
Date: 4 Aug 90 18:18:01 GMT Raw View
In article <5708@darkstar.ucsc.edu> daniel@terra.ucsc.edu (Daniel Edelson) writes:
>The rules governing names introduced in friend
>declarations appear somewhat ambiguous according
>to [E&S 90], section 11.4. It says
>
> ``If a class or function mentioned as a
> friend has not been declared its name is
> entered in the same scope as the name of
> the class containing the declaration.''
>
>
>Does this imply that a friend declaration in a nested
>class declares a member function of the enclosing class?
>E.g.,
This is an excellent question. This is just the kind of question that ought
to be posted directly to comp.std.c++ (where it may get a more definitive
response).
>Then again, in section 3.2 the discussion of class scope says that
>``A name first declared by a friend declaration belongs to the
>global scope;'' which, if true, contradicts the 11.4 statement and
>renders this discussion moot. Is there a diffinitive answer as to
>which section is correct?
If you find "bugs" (e.g. contradictions) in the C++ Reference Manual,
this should be noted over in comp.std.c++. That will increase the
probability that such problems will come to the attention of the folks
who are currently drafting the C++ standard.
i
n
e
w
s
s
u
c
k
s
r
o
y
a
l
--
// Ron Guilmette
// C++ Entomologist
// Internet: rfg@ncd.com uucp: ...uunet!lupine!rfg
// Motto: If it sticks, force it. If it breaks, it needed replacing anyway.