Member function pointer woes

Giovanni Bajo giovannibajo@libero.it
Tue Jun 29 12:24:00 GMT 2004


Albert Antony wrote:

> I need to pass a pointer-to-member-function as a parameter to a
> function
> which takes pointer-to-function as an argument. Is there any way to
> do it
> besides overloading the function?

This has nothing to do with GCC development. What you are trying to do is a
closure of the member function pointer. There are several ways to do it. Please
look into std::mem_fn, and also the Boost library (boost::bind), or consult a
good C++ book.

Giovanni Bajo




More information about the Gcc mailing list