title: I cannot pass lambda as std::function
body: <p>Let's focus on this example:</p>
  
  <pre><code>template&lt;typename T&gt;
  class C{
      public:
      void func(std::vector&lt;T&gt;&amp; vec, std::function&lt;T( const std::string)&gt;&amp; f){
          //Do Something
      }
  };
  </code></pre>
  
  <p>And now, I am trying:</p>
  
  <pre><code>std::vector&lt;int&gt; vec;
  auto lambda = [](const std::string&amp; s) { return std::stoi(s); };
  C&lt;int&gt; c;
  c.func(vec, lambda);
  </code></pre>
  
  <p>It causes errors:</p>
  
  <pre><code>no matching function for call to ‘C&lt;int&gt;::func(std::vector&lt;int, std::allocator&lt;int&gt; &gt;&amp;, main()::&lt;lambda(const string&amp;)&gt;&amp;)’
       ref.parse(vec, lambda);
  </code></pre>
  
  <p>Please explain me what is not ok and how to implement it with std::bind as well.</p>