You don't really need to use the typedef. You're just using the typedef to create a name for a type, then using that type to define your pointer, and in a typecast to initialize the pointer. If you really want to, you can use the type directly for both of those, but you end up repeating the same (often lengthy) type for both the definition and the typecast. For a somewhat simplified, standalone example:
struct XXX {
int member() { return 0; }
int member(int) { return 1; }
};
int main() {
int (XXX::*pmfv)(void) = (int (XXX::*)())&XXX::member;
int (XXX::*pmfi)(int) = (int (XXX::*)(int))&XXX::member;
return 0;
}
While this is possible, and should be accepted by any properly functioning compiler, I can't say I'd really advise it -- while it creates and initializes the pointer in a single statement, if the type involved has a long name, it's probably going to end up as a couple of lines of code anyway, just due to the length.
I believe C++ 0x's, auto
should allow the first example above to be shortened to something like this:
auto pmf = (int (XXX::*)())&XXX::member;
This should make it much easier to avoid the typedef (and depending on the compiler you're using, you may already have this available).