It's a bit confusing because you've called both a variable and a function "visit", so I'll pretend the order definition is instead:void order( void (Foo::*fn) (int,int) )

"fn" is a pointer, so "*fn" dereferences that pointer as usual. fn was a pointer-to-member-function, so *fn is just a member-function.i.e. fn is "&Foo::visit" and *fn is "Foo::visit"

"object->" is the regular syntax for accessing members of an object.Normally you don't have to write "this->" in front of members, but you can if you want to -- e.g. in test you could write "this->order(blah);" and it would mean the same as "order(blah);".

So going off the above, (this-> *fn) ends up meaning this->visit, which is the same as just saying visit.We need to wrap it in parenthesis (()) and have to include the "this->" because of the weird way that pointer-to-member-function syntax works ;)

So then, (this-> *fn)(1, 2) is the same as visit(1,2), which ends up printing "1 2".

[edit]As wqking corrected below "-> *" shouldn't have a space in it and should be "->*"

Going whole interfaces for a single functor is a bit of overkill and often the sign of Javaisms creeping into C++ (not trying to whack on Java here, but the two languages require a very different mindset).

There is a reason C++ finally got a proper std::function and lambdas and that is because there are many cases where a full-blown interface just is not the right choice.

Edit: there is also the issue of a true interface always introducing runtime polymorphism (again something that is not an issue with a JITed Java but a potential issue in C++ where runtime polymorphism is often not needed and compile time polymorphism would be enough). But that is just going off on a tangent here...