In C++, you cannot overload operator .*
Can someone give me an example for the usage of operator .*?
Simple Example:
class Action { public: void yes(std::string const& q) { std::cout << q << " YES\n"; } void no(std::string const& q) { std::cout << q << " NO\n"; } }; int main(int argc, char* argv[]) { typedef void (Action::*ActionMethod)(std::string const&); // ^^^^^^^^^^^^ The name created by the typedef // Its a pointer to a method on `Action` that returns void // and takes a one parameter; a string by const reference. ActionMethod method = (argc > 2) ? &Action::yes : &Action::no; Action action; (action.*method)("Are there 2 or more parameters?"); // ^^^^^^ Here is the usage. // Calling a method specified by the variable `method` // which points at a method from Action (see the typedef above) } As a side note. I am so glad you can not overload this operator. :-)