From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin v. Loewis" To: mrs@wrs.com Cc: oliva@dcc.unicamp.br, brendan@dgs.monash.edu.au, egcs@egcs.cygnus.com Subject: Re: EGCS: pointer to member functions. Date: Tue, 15 Jun 1999 23:27:00 -0000 Message-id: <199906160621.IAA00556@mira.isdn.cs.tu-berlin.de> References: <199906152343.QAA22571@kankakee.wrs.com> <199906152343.QAA22571@kankakee.wrs.com> X-SW-Source: 1999-06/msg00549.html > Thanks, I think you've convinced me it might not be too hard to do > this. So easily convinced? :-) So what about assignment of pointer-to-member? struct FOO { public : virtual void f1(); }; extern FOO foo; void (FOO::*fp)(); struct dummy{int i;}; struct S:dummy,FOO{ virtual void f1(); }; void (S::*x)(); int bar() { S *s = new S; FOO *foo = s; fp = &FOO::f1; (s->*fp)(); // Thunk expects vtable at offset 0 x=fp; (s->*x)(); // vtable is at offset 4 } Regards, Martin From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin v. Loewis" To: mrs@wrs.com Cc: oliva@dcc.unicamp.br, brendan@dgs.monash.edu.au, egcs@egcs.cygnus.com Subject: Re: EGCS: pointer to member functions. Date: Wed, 30 Jun 1999 15:43:00 -0000 Message-ID: <199906160621.IAA00556@mira.isdn.cs.tu-berlin.de> References: <199906152343.QAA22571@kankakee.wrs.com> X-SW-Source: 1999-06n/msg00549.html Message-ID: <19990630154300._W2VQ9QeoqDrAO3yBOPhVhZ4Wvsky6B6PJWNtpItsvs@z> > Thanks, I think you've convinced me it might not be too hard to do > this. So easily convinced? :-) So what about assignment of pointer-to-member? struct FOO { public : virtual void f1(); }; extern FOO foo; void (FOO::*fp)(); struct dummy{int i;}; struct S:dummy,FOO{ virtual void f1(); }; void (S::*x)(); int bar() { S *s = new S; FOO *foo = s; fp = &FOO::f1; (s->*fp)(); // Thunk expects vtable at offset 0 x=fp; (s->*x)(); // vtable is at offset 4 } Regards, Martin