You can use boost :: bind (). For instance:
boost::bind(&MyClass::progress_func3, this);
is a pointer to a method that returns void and has no arguments. If your answer requires arguments, use placeholders as follows:
boost::bind(&MyClass::progress_func3, this, _1, _2)
The this pointer can be replaced by a period with an instance of MyClass .
EDIT: You should be able to use boost :: function <> and function ptr functions relatively interchangeably. For instance:
typedef boost::function< void (int, short) > Callback;
equivalently
typedef void (Callback)(int);
You may need to add it using a function in between to make the compiler happy. I know that I defined the callback using boost :: function <> and passed it as a regular function pointer.
source share