#include #include #include struct Myfun { void operator()(void) {} }; int main(int argc, char *argv[]) { Myfun f; boost::function f1(boost::ref(f)); boost::function f2 = f1; std::cout << f2.target() << std::endl; return 0; }