C++ FAQ Celebrating Twenty-One Years of the C++ FAQ!!!
(Click here for a personal note from Marshall Cline.)
Section 33:
[33.6] How can I avoid syntax errors when calling a member function using a pointer-to-member-function?

Use a #define macro.


Pretty please.

I get way too many emails from confused people who refused to take this advice. It's so simple. I know, you don't need a macro, and the expert you talked to can do it in his sleep without a macro, but please don't let your ego get in the way of what's important: money. Remember that there are other programmers who will need to read your code. So please, use a #define macro.

(Normally I dislike #define macros, but you should use them with pointers to members because they improve the readability and writability of that sort of code.)

The macro is trivial:

#define CALL_MEMBER_FN(object,ptrToMember)  ((object).*(ptrToMember))
Using the macro is also trivial. Note: FredMemFn is a typedef for a pointer-to-member type:
void userCode(Fred& fred, FredMemFn p)  // See FAQ [33.5] for FredMemFn
  int ans = CALL_MEMBER_FN(fred,p)('x', 3.14);
  // Would normally be: int ans = (fred.*p)('x', 3.14);

The reason this macro is a good idea is because member function invocations are often a lot more complex than the simple example just given. The difference in readability and writability is significant. comp.lang.c++ has had to endure hundreds and hundreds of postings from confused programmers who couldn't quite get the syntax right. Almost all these errors would have vanished had they used the above macro.

Note: #define macros are evil in 4 different ways: evil#1, evil#2, evil#3, and evil#4. But they're still useful sometimes. But you should still feel a vague sense of shame after using them.