Re: general func. ptr.

New Message Reply Date view Thread view Subject view Author view

Marcus Barnes (marcus++at++multigen.com)
Mon, 7 Jul 1997 15:22:56 -0700


On Jul 4, 12:13am, Swaminathan N. wrote:
> On Thu, 3 Jul 1997, Marcus Barnes wrote:
> > On Jul 2, 10:16am, Nicolas Gauvin wrote:
> > > My understanding is that it is not possible to save a pointer to a true
> > > member function partly because of the implicit 'this' parameter.
> >
> > It is possible to declare a pointer to a class member. The syntax is
> > described in "The C++ Programming Language, 2nd Edition", chapter 5.4.5. I
> > don't recall if any of SGI's C++ compilers support this language feature
> > yet.
>
> Pointers to data members and member functions are currently supported. The
> question is whether pointers to member functions and pointers to static or
> plain ol' functions are interchangeable, which of course, they are not.

Correct.

> However, pointers to member functions in C++ support the virtual function
> mechanism, meaning that a call through a base class PMF might actually call a
> derived class virtual function.

Yes that's true ... if the call is made thru an object pointer that points to
an instance of a derived class.

Regards.

--
+ Marcus Barnes, Technical Staff        mailto:marcus++at++multigen.com +
+ Multigen Inc.                         http://www.multigen.com    +
+ 550 S. Winchester Blvd.               phoneto:1-408-556-2654     +
+ Suite 500 San Jose CA 95128           faxto:1-408-261-4102       +
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:35 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.