Why would piece of code like this:
boost::bind (SomeFunc<float>, function arguments go here);
produce this error:
no matching function for call to bind(<unresolved overloaded function type>
THanks
Why would piece of code like this:
boost::bind (SomeFunc<float>, function arguments go here);
produce this error:
no matching function for call to bind(<unresolved overloaded function type>
THanks
It could be that your function SomeFunc<float>
is overloaded, in which case boost::bind
cannot deal with this. You have to implement a manual solution, see here for more details:
You need to use a static_cast
to tell the compiler which overload to pick if it's ambiguous, e.g.:
#include <boost/bind.hpp>
void foo(int) {}
void foo(double) {}
int main() {
boost::bind(static_cast<void(*)(int)>(&foo), _1);
}
Sometimes "unresolved overloaded function type" can mean "none of the overloads are viable" in which case you need to figure out why it can't use any and fix that.