title: Passing class instance and method as argument to another function in C++
body: <p>I have two classes. One class has a method that takes a function as a parameter and that passed function is expected to have a string as an argument. For example:</p>
  
  <pre><code>class Dog{
  public:
      void doDogThings(std::function &lt;void(std::string)&gt; theFunction);
  
  }
  
  class Cat{
  public:
      void doCatThings(std::string stringInput);
  }
  </code></pre>
  
  <p>And here they are in action</p>
  
  <pre><code>int main(){
     Cat aCat;
     Dog aDog;
     std::string theString = "Oh jeez";
     aDog.doDogThings(&lt;&lt; insert cat's method and argument here &gt;&gt;);
     .....
  </code></pre>
  
  <p>This is the part that is fouling me up here; I know I should use</p>
  
  <pre><code>bind(&amp;Cat::doCatThings, ref(aCat) ....?.....);
  </code></pre>
  
  <p>But I am stuck on how to pass the argument for the Cat method as a parameter to this function pointer. 
  Any help would be greatly be appreciated. Thanks.</p>