title: C++0x lambda wrappers vs. bind for passing member functions
body: <p>This is basically a question about the readability, style, performance of 2 different approaches to creating/passing a functor that points to a member method from within a class constructor/method.</p>
  
  <p>Approach 1:</p>
  
  <pre><code>using namespace std::placeholders;
  std::bind( &amp;MyClass::some_method, this, _1, _2, _3 )
  </code></pre>
  
  <p>Approach 2:</p>
  
  <pre><code>[ this ](const arg1&amp; a, arg2 b, arg3&amp; c) -&gt; blah { some_method( a, b, c ); }
  </code></pre>
  
  <p>I was wondering if using the lambda is just gratuitous in this situation, in some respects it is easier to see what is going on, but then you have to explicitly provide the arg types. Also i prefer not to have "using namespace whatever;" but then it makes the bind expression needlessly verbose (eg. _1 becomes std::placeholders::_1), and lambda avoids this issue.</p>
  
  <p>Finally i should note that for the purposes of this question, some_method is a big function that does lots of things, and would be a pain to directly copy into a lambda body.</p>
  
  <p>If this question seems too vague, then we can focus on answers to the performance differences, if any.</p>
  
  <p>EDIT: A non-trivial use case.</p>
  
  <pre><code>MyClass::MyClass()
  :    some_member_( CALLBACK_FUNCTOR )
  {}
  </code></pre>
  
  <p>As you can see, the CALLBACK_FUNCTOR used in an initializer list (defined with approach 1 or 2) makes it difficult to scope a using declaration (afaik), and obviously we wouldnt bother wrapping a member method that we intended to call straight away.</p>