No. Although std::bind1st()
creates a function object with a call operator taking and int
, it is not a void(*)(int)
. The only way to turn a void(*)(void*, int)
into a void(*)(int)
is to have a forwarding function which obtains the void*
from global resources, e.g.,
static void* data = 0; // probably needs to be set to a more suitable value
void f_forward(int value) {
f(data, value);
}
Anybody providing a callback which doesn't take a user-defined context, e.g., in the C-like interface a void*
which is just passed through, didn't think too hard about the interface.