I've got a function that I want to take an optional boost::function argument as a callback for reporting an error condition. Is there some special value I can use a the default value to make it optional?
For example, with a regular function pointer I can do:
void my_func(int a, int b, t_func_ptr err_callback=NULL) {
if (error && (err_callback != NULL))
err_callback();
}
Can I do something similar with boost::function replacing the function pointer?