I've always believed that function pointers don't require an ampersand:
Do function pointers need an ampersand
Yet, every example I've seen of using boost::bind
shows one, and my compiler - in most situations - gives a typically inscrutable error message if it's omitted.
synchronize(boost::bind(&Device::asyncUpdate , this, "ErrorMessage")); // Works
synchronize(boost::bind(Device::asyncUpdate , this, "ErrorMessage")); // Fails
Am I wrong in assuming that boost::bind
's first parameter is basically function pointer?
static
members functions behave like free functions w.r.t function pointers. They can't bind to member pointers and you can omit&
. – Ferryman