🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: C++ Standards Bug!!!

#1758
From: Steve Clamage
Date: Mon, 21 Aug 1995 02:46
40 lines
1920 bytes
Ray Brown <102336.141@CompuServe.COM> writes:

>Distribution:
>>You can write it without a typedef like this:

>>void (B::* A::var)(short) = B::Foo;

>All right, so this turned out to be a compiler question to some 
>extent. The solution you gave does not work under gcc version 
>2.5.6: the error message is "multiple `::' terms in declarator 
>invalid." It does work with some other compilers.

>However, consider this: let the declaration of var be
>	static void (B::*const var)(short);
>within struct A. How do you perform the initialization now?  ...

>Any ideas? Standards bug after all or common compiler bug?

I still don't see the problem. If 'var' is const, you initialize it

	void (B::* const A::var)(short) = B::Foo;

There aren't any special rules at work here, but according to your
report, some compilers have trouble with the syntax. For almost
every feature of every language, some compiler somewhere has a
bug. That doesn't in itself mean the standard has a bug.

The syntax for pointer-to-member is horribly ugly -- I think on
purpose :-) -- and is not widely used. Consequently, it takes a
while for all the bugs to disappear from all compilers.

Finally, why are you allergic to typedefs? I prefer to use typedefs,
particularly for function pointers since the syntax is too hard
to read.

---
Steve Clamage, stephen.clamage@eng.sun.com

--
Steve Clamage, stephen.clamage@eng.sun.com
Technical Details
Message-ID: <418s1k$7oc@engnews2.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!clamage
References: <MATT.95Aug19114614@Austern> <MATT.95Aug20111508@Austern>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!clamage
From: clamage@Eng.Sun.COM (Steve Clamage)
Newsgroups: comp.std.c++
Subject: Re: C++ Standards Bug!!!
Date: 21 Aug 1995 02:46:12 GMT
Organization: Sun Microsystems Inc., Mountain View, CA
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <418s1k$7oc@engnews2.Eng.Sun.COM>
References: <MATT.95Aug19114614@Austern> <MATT.95Aug20111508@Austern>
NNTP-Posting-Host: taumet.eng.sun.com
X-Newsreader: NN version 6.5.0 #21 (NOV)