[comp.lang.c++] Correction to Pointer/Reference to Members

neath@solar-1.stars.flab.Fujitsu.JUNET (05/03/89)

Well, it seems that I tried to simplify my code example a little too much,
resulting in a code fragment that is both wrong *AND* dosn't compile! Anyway,
what I really meant to give as a code fragment is below :-)

	class A {
	  int a;
	public:
	  A(int n) {a = n;};
	  void print();
	};
	void A::print () { cout << a; };
	typedef void A::MEMF;
	MEMF* p1 = A::print;                // This is accepted by cfront
	MEMF& p2 = *A::print;               // This results in bus error!

At least now cfront will accept the first line commented as such!

Regards
Martin Neath <neath@dsg.ti.com>
------------------------------------------------------------------------
 DISCLAIMER: As always, the opinions expressed above are strictly my own
 and do not reflect those of my employer, Texas Instruments.
------------------------------------------------------------------------
--
Regards,
Martin