title: Rewrite boost flavored code in C++11 manner (Boost.Bind, Boost.Function)
body: <p>I have some legacy code I'd like to rewrite in C++11 style.
  There are some <code>boost::function</code> defined as following</p>
  
  <pre><code>// void One::first(int)
  boost::function&lt;void()&gt; a1 = boost::bind(&amp;One::first, this, this-&gt;a); 
  
  // void Two::second()
  boost::function&lt;void()&gt; a2 = boost::bind(&amp;Two::second, this); 
  
  // void Three::third(int, const std::string &amp;)
  boost::function&lt;void()&gt; a3 = boost::bind(&amp;Three::third, this, 8, str); 
  </code></pre>
  
  <p>These variables are passed to function <code>foo</code> in different places:</p>
  
  <pre><code>foo(somearg,  a1);          
  foo(anotherarg, a2);
  foo(othearg, a3);
  </code></pre>
  
  <p>where <code>foo</code> is defined like following</p>
  
  <pre><code>void foo(const Obj &amp;obj, boost::function&lt;void()&gt; caller) {
    ...
    caller();
    ...
  }
  </code></pre>
  
  <p>What is the best way to rewrite this code in C++11 style?</p>