This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: global scope in friends



At 08:38 AM 2/4/99 +0100, you wrote:
>  friend A ::B::C();
>  friend A::B ::C();
>
>Is it me, or is it C++?

Since the guys that made C++ and the standard for C++ were presumably smart
enough not to make the grammar ambiguous, I expect the scope op must be
preceded by whitespace to act as global scope, so A::B::C will be treated
as C, in the scope of B, which is in the scope of A. In that case the code
you posted should explode with an undefined reference error if you try to
compile it.

-- 
   .*.  "Clouds are not spheres, mountains are not cones, coastlines are not
-()  <  circles, and bark is not smooth, nor does lightning travel in a
   `*'  straight line."    -------------------------------------------------
        -- B. Mandelbrot  |http://surf.to/pgd.net
_____________________ ____|________     Paul Derbyshire     pderbysh@usa.net
Programmer & Humanist|ICQ: 10423848|