🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: C++ Standards Bug!!!

#1746
From: Steve Clamage
Date: Sat, 19 Aug 1995 19:46
32 lines
1251 bytes
Distribution:
Ray Brown <102336.141@CompuServe.COM> writes:

>The challenge: try to rewrite the last two lines of this code 
>without a typedef (typedefs should never be required, right?).

>//////////////////////////////////////////////////////////////
>struct B
>{
>  void Foo(short);
>};

>struct A
>{
>  static void (B::* var)(short);
>};

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

You can write it without a typedef like this:

void (B::* A::var)(short) = B::Foo;
--
Steve Clamage, stephen.clamage@eng.sun.com


---
[ 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.95Aug19114614@Austern>
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt
References: <MATT.95Aug18190716@physics2.Berkeley.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt
From: clamage@Eng.Sun.COM (Steve Clamage)
Newsgroups: comp.std.c++
Subject: Re: C++ Standards Bug!!!
Date: 19 Aug 1995 19:46:14 GMT
Organization: Sun Microsystems Inc., Mountain View, CA
Approved: Matt@Austern
Message-ID: <MATT.95Aug19114614@Austern>
References: <MATT.95Aug18190716@physics2.Berkeley.EDU>
NNTP-Posting-Host: austern.hip.berkeley.edu