I'm trying to pass an overloaded function pointer as shown below in the sample code.
class Sample
{
uint32_t method(char* input1, double input2);
uint32_t method(double input1);
}
template<class T, class... Args)
void processInput(T &&t, Args&&... a)
{
std::packaged_task<uint32_t(Args...)> task(std::bind(t, a...));
// other processing
}
// Caller invokes the below API
Sample* obj = new Sample();
processInput(static_cast<uint32_t(*)(double)>(&Sample::method), &*obj, 2.0f);
But this code doesn't compile. It keeps complaining that it can't determine which instance of overloaded function is intended. I referred several examples:
http://en.cppreference.com/w/cpp/language/static_cast
Can somebody help in pointing out what is going wrong here?