title: Callback with variadic template to ambiguous overloads
body: <p>In C++0X, I want to write generic caller/callback functions using variadic templates. First hurdle: The callees are member functions. So far so good. Second hurdle: There are many overloaded member functions of the same name.</p>
  
  <p>How would I solve this? My primary reference is this <a href="http://yvan.seth.id.au/Entries/Technology/Code/boost__bind_and__unresolved_overloaded_function_type_.html" rel="nofollow">fine article</a>, but I can't quite make it work.</p>
  
  <p>OK, let's dive in:</p>
  
  <pre><code>Class Foo
  {
      void bar(int ID, int, int) { ... }
      void bar(int ID) { ... }
      void bar(int ID, double, float, void(Baz::*)()) const { /* jikes */ }
  
      template&lt;typename ... Args&gt;
      void sendBarToID_15(std::function&lt;void(int, Args...)&gt; refB, Args ... args)
      {
          refB(15, args...);
      }
  
      void yum()
      {
          sendBarToID_15(&amp;Foo::bar, this, 17, 29); // want first version
      }
  };
  </code></pre>
  
  <p>However, I cannot compile the call in yum() because the overload prevents template resolution. According to the referenced article, I should explicitly create a function object</p>
  
  <pre><code>f = magic::make_function&lt;help, me&gt;(&amp;Foo::bar)
  </code></pre>
  
  <p>and then leisurely call <code>sendBarToID_15(f, this, 17, 29)</code>.</p>
  
  <ol>
  <li><p>How can I make this work?</p></li>
  <li><p>Bonus points for std::bind magic that obviates "this" in the last line.</p></li>
  <li><p>Extra bonus points for making 15 parametric in a useful way.</p></li>
  </ol>
  
  <p>Lots of thanks!!</p>