#include struct Foo { char* operator()() { return "Hello World"; } }; int main(int argc, char** argv) { // create a function object (functor) variable Foo f; // call the functor std::cout << f() << std::endl; return 0; }