[lug] (OT) C++ ?, pointers to member functions

Tkil tkil at scrye.com
Tue Aug 7 17:04:17 MDT 2001


>>>>> "Scott" == Scott A Herod <herod at interact-tv.com> writes:

Scott> How can I pass a pointer to a non-static member function?

you just need to pass an instance for the non-static member function
to operate upon.  please see:

   http://www.parashift.com/c++-faq-lite/pointers-to-members.html

also, look at the STL; its use of function objects covers most of the
reasons one would normally need this construct.

ds> For that to work, it needs to be a virtual function.

that shouldn't be the case.

t.



More information about the LUG mailing list