I\'ve got a library that I need to use that defines the following:
typedef void CallbackFunction(const int& i);
and has a function to regis
You can't use lambdas, because your registerCallback
function expects pointer to non-member function. The only way to pass additional parameter to free standing function is 1) using global (static) data or 2) making it a template taking compile time constants, e.g.
template void callback(const int& i)
{ /* can use data */ }
registerCallback(callback<10>);