Rodney Morison wrote:
Peter Soetens wrote:
Hi,
I was looking for a way to convert a member function type:
bool (X::*)(int) or bool (X::)(int)
to the 'C' equivalent, without the class pointer:
bool (*)(int) or bool(int)
You might want to read the (excellent) article on function pointers in C++ at http://www.codeproject.com/cpp/FastDelegate.asp. That will explain why your question is highly nontrivial, but a worthy query for certain applications (like delegates).
The example suite (link in my previous post in this thread) coincidentally contains a member function wrapper that uses member function pointers as non-type template parameters. That technique could be used to build an equally fast delegate without relying upon compiler internals. Regards, Tobias