Howto: c++ Function Pointer with default values

Function pointers themselves can’t have default values. You’ll either have to wrap the call via the function pointer in a function that does have default parameters (this could even be a small class that wraps the function pointer and has an operator() with default paremeters), or have different function pointers for the different overloads of your functions.

Leave a Comment