Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!ucla-cs!zen!ucbvax!hplabs!well!mitsu From: mitsu@well.UUCP (Mitsuharu Hadeishi) Newsgroups: comp.lang.c++ Subject: Re: cfront/c++ problem Message-ID: <3938@well.UUCP> Date: Sat, 12-Sep-87 16:27:30 EDT Article-I.D.: well.3938 Posted: Sat Sep 12 16:27:30 1987 Date-Received: Sun, 13-Sep-87 10:45:00 EDT References: <6191@apple.UUCP> <253@otc.oz> Reply-To: mitsu@well.UUCP (Mitsuharu Hadeishi) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 32 Keywords: pointer to virtual method In article <253@otc.oz> mikem@otc.oz (Mike Mowbray) writes: >In article <6191@apple.UUCP>, joemac@apple.UUCP (Joe MacDougald) says: >> struct T { /* ........ */ }; >> >> int T::getf() { return f; } >> >> typedef int (T::*PROC)(); // S 5.4.5 p. 154 : pointer to member fn >> // of T taking no args, returning int. >> main() >> { >> T t; // t is an instance of T >> PROC p = &T::getf; // p points to T's member function getf >> >> /*ERROR*/ int r = (t.*p)(); // call function pointed at by p, assign to r >> } >> It seems to be that the correct syntax should be: PROC p = T::getf; Is that not right? However, the preprocessor should have gronked there, not later (type mismatch). -Mitsu CDI Research & Development Electronic Arts This line is for news This line is for news This line is for news This line is for news Eat this line, sucker!