Original Post
I posted about this in the Game Programming forum, but maybe it's more appropriate here.. and I will elaborate on the question: Using the command pattern with function pointers (instea dof writing new Execute method for command classes, use single class per reciever and point the execute method to desired function), i get decent usable functionality. However, I can only make calls to functions with no arguments (Because of "typedef void (Game::* Action)();", which is set for no arguments!!) My solution was to make another subclass of Command class, with Action typedefed with an argument.. So I had to prototype new Execute method in Command, and make it do nothing in other subclass, of course. Anyway, it seemed like this should work for me, but when I tried to run it it gives message "illegal call of non-static member function" because of this line: boost::shared_ptr cmd(new StringCommand(&game, &Game::OpenMenu(file))); StringCommand is the subclass of Command that should accept 1 std string as argument. Am I just trying to send address of function+argument to the StringCommand object wrong, or is this just impossible to work anyway? If any other code is needed, id be happy to post some.