title: C++ overloaded function pointer ambiguity
body: <p>I'm trying to pass an overloaded function pointer as shown below in the sample code.</p>
  
  <pre><code>class Sample
  {
    uint32_t method(char* input1, double input2);
    uint32_t method(double input1);
  }
  
  template&lt;class T, class... Args)
  void processInput(T &amp;&amp;t, Args&amp;&amp;... a)
  {
    std::packaged_task&lt;uint32_t(Args...)&gt; task(std::bind(t, a...));
    // other processing
  }
  
  // Caller invokes the below API
  Sample* obj = new Sample();
  processInput(static_cast&lt;uint32_t(*)(double)&gt;(&amp;Sample::method), &amp;*obj, 2.0f);
  </code></pre>
  
  <p>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:</p>
  
  <p><a href="https://stackoverflow.com/questions/4364599/c-overloaded-method-pointer">C++ overloaded method pointer</a></p>
  
  <p><a href="http://en.cppreference.com/w/cpp/language/static_cast" rel="nofollow noreferrer">http://en.cppreference.com/w/cpp/language/static_cast</a></p>
  
  <p>Can somebody help in pointing out what is going wrong here?</p>