Article View: comp.std.c++
Article #1754Re: C++ Standards Bug!!!
From: Ray Brown
Date: Sun, 20 Aug 1995 19:15
Date: Sun, 20 Aug 1995 19:15
32 lines
1671 bytes
1671 bytes
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? Oddly enough, your answer still works with some compilers, even though these very compilers usually require that the full type of the variable to be initialized (var) be given at initialization time. I have not found a way to express the type (with "const") without a typedef at initialization time and I can't explain why it would not be required to do so. Any ideas? Standards bug after all or common compiler bug? -- ################################################################# Email: Ray.Brown@lawson.com Phone: (612) 379-8086 x4393 --- [ 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:
<MATT.95Aug20111508@Austern>Path:
arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!MattReferences:
<MATT.95Aug19114614@Austern>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt From: Ray Brown <102336.141@CompuServe.COM> Newsgroups: comp.std.c++ Subject: Re: C++ Standards Bug!!! Date: 20 Aug 1995 19:15:08 GMT Organization: Lawson Software Approved: Matt@Austern Message-ID: <MATT.95Aug20111508@Austern> References: <MATT.95Aug19114614@Austern> NNTP-Posting-Host: austern.hip.berkeley.edu