Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bbn!apple!rutgers!att!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c++ Subject: Re: address of virtual function (revisited) Message-ID: <9263@alice.UUCP> Date: 29 Apr 89 02:12:49 GMT References: <904@garya.Solbourne.COM> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 25 In article <904@garya.Solbourne.COM>, garya@Solbourne.COM (Gary Aitken) writes: > Or am I missing something here? If I do > fp = &A::f; > and subsequently do a > (bp->*fp)(); > will this somehow go through the virtual table and actually call B::f if > bp is REALLY a B* object pointer? Yes. What you can't do is bind an object and a function pointer into a single value. That is, there's no type you can give x that will let you do this sanely: x = &bp->f; It would be nice, but it is extremely difficult to compile into C because C doesn't let you get your tentacles into its calling sequence portably. -- --Andrew Koenig ark@europa.att.com