/* To create a command that calls Action on an instance of class MyClass, a client simply writes */ MyClass* receiver = new MyClass; // ... Command* aCommand = new SimpleCommand(receiver, &MyClass::Action); // ... aCommand->Execute(); /* Keep in mind that this solution only works for simple commands. More complex commands that keep track of not only their receivers but also arguments and/or undo state require a Command subclass. */