🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Forward declaration of class member functi

#3732
From: Steve Clamage
Date: Tue, 19 Mar 1996 04:53
28 lines
1809 bytes
In article 199603182248040068@msn.com, "Ron Burk" <RonBurk@msn.com> writes:
>I am having difficulty finding language in the draft
>that establishes the legality or illegality of the following:
>
>class Forward;
>
>class Any {
>    friend int Forward::SomeFunc(int SomeArg);
>    };

It is not valid. You cannot mention the name of a class member until the
class definition has been seen. To interpret the qualified-id A::B, the name
B must be looked up in the scope of A. If A has not been defined, the lookup
fails, and A::B must be considered undefined. Refer to chapters 3, 9, and 10
of the draft standard.

If this sort of thing were allowed, you could add members to a class
without modifying the class definition, thus violating the One-Definition
Rule.

---
Steve Clamage, stephen.clamage@eng.sun.com
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
Technical Details
Message-ID: <4iktec$btv@engnews1.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
References: <UPMAIL07.199603182248040068@msn.com>

Show Full Headers
Complete Article Headers
From: clamage@Eng.Sun.COM (Steve Clamage)
Message-ID: <4iktec$btv@engnews1.Eng.Sun.COM>
X-Original-Date: 19 Mar 1996 00:00:12 GMT
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
Date: 19 Mar 96 04:53:49 GMT
Approved: fjh@cs.mu.oz.au
Newsgroups: comp.std.c++
Subject: Re: Forward declaration of class member functi
Organization: Sun Microsystems Inc.
References: <UPMAIL07.199603182248040068@msn.com>
Reply-To: clamage@Eng.Sun.COM
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMU495OEDnX0m9pzZAQFkvAF+NpLTaPMXHjB6ei2cvjMKcRpEKL73GTR5
 xvQDaZtemJbGux4y3bbWToZmyKgWLcic
 =TKWt