🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2897

Friend Declaration Scope

#2897
From: Craig P. Forbes
Date: Fri, 08 Dec 1995 18:01
40 lines
1327 bytes
When a friend is declared within a class (or sub class) at what
scope is the friend defined to be in.
Is it the enclosing scope or global scope?

i.e.

class c1 {
   class c2 {
      friend class b;
      friend int fn();
   };
};

In what scope are b and fn().

On a related note I will reiterate a question I resently saw but
have not seen an answer.
Can friends be defined within the friend class?

i.e. Is this legal?
class c1 {
   friend class fc { ... };
};


I have been digging through the draft standard with no luck.

Thanks

-- 
Craig P. Forbes                      McCabe & Associates
                                     5501 Twin Knolls Road, Suite 111
craig@mccabe.com                     Columbia, MD 21045


---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <30C86A87.41C67EA6@mccabe.com>
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt
From: "Craig P. Forbes" <craig@mccabe.com>
Newsgroups: comp.std.c++
Subject: Friend Declaration Scope
Date: 08 Dec 1995 18:01:58 GMT
Organization: McCabe & Associates, Inc.
Approved: Matt@Austern
Message-ID: <30C86A87.41C67EA6@mccabe.com>
NNTP-Posting-Host: austern.hip.berkeley.edu