I am trying to create a copy of a boost::function
by using a pointer and call that function using that pointer. My questions are
- cloning a
boost::function
that way is something correct - the call to
fp->target()
should call or not the function wrapped by the boost::function?
Thanks a lot
boost::function<void()> f = boost::bind(&my_f,my_value);
boost::function<void()> fp* = new boost::function<void()>( f ); // clone f
typedef void(*fptr_type)();
fp->target<fptr_type>(); // doesn't work! Is this correct?
fp->operator(); // doesn't compile
//=>error: statement cannot resolve address of overloaded function