#include #include struct Functor { Functor(void) { std::cout << "Functor constructor (" << this << ')' << std::endl; } Functor(const Functor&) { std::cout << "Functor copy constructor (" << this << ')' << std::endl; } ~Functor(void) { std::cout << "Functor destructor (" << this << ')' << std::endl; } void operator()(void) const { std::cout << "Hello world!" << std::endl; } std::string memfunc(void) const { return std::string("hello world!!!!!!"); } }; int main(void) { Functor func; boost::function0 f(func); return 0; }