Given my function that takes a function pointer as parameter
void call_func(std::function<void()>func) {
func();
}
The most straight forward way is something like
void no_op() {
;
}
void call_func(std::function<void()>func = no_op) {
func();
}
Is there a cleaner way to do this so that I can avoid creating the literally useless no_op
function?