title: How to make a functor from a member function?
body: <p>I want <code>run</code> to call <code>c.drive()</code>:</p>
  
  <pre><code>#include &lt;functional&gt;
  using namespace std;
  
  struct Car {
      void drive() { }
  };
  
  template &lt;typename Function&gt;
  void run(Function f) {
      f();
  }
  
  int main() {
      Car c;    
      run(bind1st(mem_fun(&amp;Car::drive), &amp;c));    
      return 0;
  }
  </code></pre>
  
  <p>This does not compile and the error messages does not help me:</p>
  
  <p>at f():<br>
  no match for call to ‘(std::binder1st&lt;std::mem_fun_t&lt;void, Car&gt; &gt;) ()’  </p>
  
  <p>at the call to run:<br>
  no type named ‘first_argument_type’ in ‘class std::mem_fun_t&lt;void, Car&gt;’<br>
  no type named ‘second_argument_type’ in ‘class std::mem_fun_t&lt;void, Car&gt;’         </p>
  
  <p><strong>No boost please.</strong></p>
  
  <p><strong>Update:</strong> even though the problem is solved, I would be very happy to see TR1/C++0x solutions!</p>