Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!uwvax!astroatc!nicmad!hill
From: hill@nicmad.UUCP (Ray Hill)
Newsgroups: comp.lang.c++
Subject: another C++ problem
Message-ID: <2173@nicmad.UUCP>
Date: Tue, 1-Dec-87 17:29:11 EST
Article-I.D.: nicmad.2173
Posted: Tue Dec  1 17:29:11 1987
Date-Received: Sat, 5-Dec-87 14:18:59 EST
Reply-To: hill@nicmad.UUCP (Ray Hill)
Organization: Nicolet Instruments, Biomedical Division
Lines: 30



Yet another crazy C++ problem:

The below code is a generalization of a problem we are seeing with C++
compilers and the use of callbacks. Let me know if this works with your C++ 
compiler or what I am doing wrong. I have tested it with all the C++ compilers
available here. Using C++ 1.1, it compiles and runs on a Masscomp 5500, while
using C++ 1.2 on both a Sun and a Pyramid it "bus error"s and "memory faults"
during the C++ compile. (could this be related to 1.2?)

						Thanks
						Ray Hill (hill@nicmad)
------------------------- problem starts here -------------------------
class base
  {
public:
  void method1() {};
  virtual void method2() {};
  };

typedef void (base::*PROC)();
  
main()
  {
  PROC m;
  base *b = new base();

  m = &(base :: method1); (b->*m)(); 
  }