#include #include struct stateful_type { int operator(int) const { return 0; } }; int main() { stateful_type a_function_object; boost::function1 f; f = boost::ref(a_function_object); boost::function1 f2(f); }