Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hpl-opus!hpnmdla!hpmwtd!jeffa From: jeffa@hpmwtd.HP.COM (Jeff Aguilera) Newsgroups: comp.lang.c++ Subject: Re: cfront 2.0 bug 900214_03 Message-ID: <1520021@hpmwjaa.HP.COM> Date: 15 Feb 90 22:25:21 GMT References: <25DA6B8F.24446@paris.ics.uci.edu> Organization: HP Microwave Tech. - Santa Rosa, Ca. Lines: 55 > i = (this->*fmp) (); From my cfront bug file: /* The rules for calling a pointer to a member function are given in the C++ Reference Manual: 5.5 Pointer-to-Member Operators The binary operator .* binds its second operand, which must be of type "pointer to member of class T" to its first operand, which must be of class T or of a class publicly derived from class T. The result is an object or a function of the type specified by the second operand. The binary operator ->* binds its second operand, which must be of type "pointer to member of T" to its first operand, which must be of "pointer to T" or "pointer to class publicly derived from T." The result is an object or a function of the type specified by the second operand. */ class X { public: X(); void (X::*PMF)(); void MF(); void okay(); void stillokay(); void wishlist(); }; void X::MF() {} X::X() { PMF = &X::MF; } void X::okay() { (this->*PMF)(); } void X::stillokay() { ((*this).*PMF)(); } //void X::wishlist() { (*PMF)(); } //(this-> must be explicit, unlike access to other members) //CC X.c: //"X.c", line 18: error: pointer to member de referenced //"X.c", line 18: error: object or pointer missing for ? of type void X::() //CC: 2 errors //void bad(X*const that) { (that->*PMF)(); } //CC X.c: //"X.c", line 25: error: PMF undefined //"X.c", line 25: error: pointer to member expected in .* expression: any //CC: 2 errors //void worse(X& self) { (self.*PMF)(); } //CC X.c: //"X.c", line 31: error: PMF undefined //"X.c", line 31: error: pointer to member expected in .* expression: any //CC: 2 errors