title: Could not deduce template argument for std::function from std::bind
body: <p>I'm trying to find a way to call a number of class member functions, each having differing parameters, with certain known functionality happening before and after the call.</p>
  
  <p>This wrapper function is what I've tried, but for example the final call to it doesn't compile with error:</p>
  
  <blockquote>
    <p>'bool Wrapper(Work * ,std::function&lt; bool(Args...)>,Args &amp;&amp;...)' : could
    not deduce template argument for
    'std::function&lt; bool(double,std::string,Args...)>' from
    'std::_Bind&lt; true,bool,std::_Pmf_wrap&lt; bool (__thiscall Work::*
    )(double,std::string),bool,Work,double,std::string>,Work *const >'</p>
  </blockquote>
  
  <pre><code>class Work
      {
      public:
          void DoWork(int a, double b, string c);
  
      private:
          void Pre() {};
          void Post() {};
          bool Step1() { return true; }
          bool Step2(int) { return true; }
          bool Step3(double, string) { return true; }
      };
  
  template&lt;typename... Args&gt;
  bool Wrapper(Work *work, std::function&lt;bool(Args...)&gt; func, Args&amp;&amp;... args)
      {
      work-&gt;Pre();
      bool ret = func(std::forward&lt;Args&gt;(args)...);
      work-&gt;Post();
      return ret;
      }
  
  void Work::DoWork(int a, double b, string c)
  {
      if (!Wrapper&lt;&gt;(this, std::bind(&amp;Work::Step1, this))) // error
          return;
      if (!Wrapper&lt;int&gt;(this, std::bind(&amp;Work::Step2, this), a)) // error
          return;
      if (!Wrapper&lt;double, string&gt;(this, std::bind(&amp;Work::Step3, this), b, c)) // error
          return;
  }
  
  int main()
  {
      Work work;
      work.DoWork(1, 2.0, "three");
      return 0;
  }
  </code></pre>
  
  <p>(Putting the pre- and post- functionality inside the steps would seem at first glance far preferable but that's undesirable as the above is a grossly simplified example of the actual code, and the steps have multiple places of returns, and no tests.)</p>
  
  <p>I thought the explicit template arguments would make the template resolution possible. What am I doing wrong?</p>