title: How to use lambda functions with boost::bind/std::bind in VC++ 2010?
body: <p>I have some lambda functions which I want to bind using either boost::bind or std::bind. (Don't care which one, as long as it works.) Unfortunately both of them give me different compiler erros:</p>
  
  <pre><code>auto f = [](){ cout&lt;&lt;"f()"&lt;&lt;endl; };
  auto f2 = [](int x){ cout&lt;&lt;"f2() x="&lt;&lt;x&lt;&lt;endl; };
  
  std::bind(f)(); //ok
  std::bind(f2, 13)(); //error C2903: 'result' : symbol is neither a class template nor a function template
  
  boost::bind(f)(); //error C2039: 'result_type' : is not a member of '`anonymous-namespace'::&lt;lambda0&gt;'
  boost::bind(f2, 13)(); //error C2039: 'result_type' : is not a member of '`anonymous-namespace'::&lt;lambda1&gt;'
  </code></pre>
  
  <p>So, what is the simplest workaround for this?</p>