Hello I am a student working on a program I have that uses a callback of a member function. I came across the use of bind which is exactly what I need. I just am having difficulties getting it working.
Below is the relevant code and compile errors
// this is the API function to register callback
void register_callback_datapoint(void(*)(datapoint_t *datapoint) cb_datapoint )
// this function is my callback
void datapoint_update(datapoint_t* datapoint);
// this code is called in the aggregateThread class
boost::function<void(datapoint_t*)> f;
f = bind(&aggregateThread::datapoint_update, this, std::tr1::placeholders::_1);
register_callback_datapoint(f);
// here is the compile error
cannot convert ‘boost::function<void(datapoint_opaque_t*)>’ to ‘void (*)(datapoint_t*)
{aka void (*)(datapoint_opaque_t*)}’ for argument ‘1’ to ‘void
register_callback_datapoint(void (*)(datapoint_t*))’
Can someone help me with this please? Thank you