The raw function pointer allows only to pass pointers to free functions. You cannot pass C++ constructs like lambda or member functions. With std::bind(...) you can pass additional paramters. See:
@Thomas,
I would've favored a raw function pointer but I couldn't send a lambda to register my callback function because the function is a member of a class.
1 2 3 4 5 6 7 8 9
class ClassA
{
public:
ClassA
{
ClassB::Bind([this](){this->Func(); }); // Doesn't work if Bind is expecting a raw function pointer but works with std::function
}
void Func() { /* Do something */ }
}
I think it's because when a function is a member of a class, the function receives an invisible parameter, in my example Func is actually Func(ClassA) while the function pointer is expecting a function with no params.