title: No matching function call error with usage of, lambda expressions and std::function.
body: <p>I am trying to use this lambda expression in my code. And looks like something's wrong with definition of functor or lambda. </p>
  
  <p>I believe the lambda expression is true. but I can't satisfy the prototype of function I defined. </p>
  
  <p>Function definition: </p>
  
  <pre><code>    template&lt;typename E, typename container&gt; 
  void for_each(Iterator&lt;E,container&gt; begin, std::function&lt;void(E&amp;)&gt; fun)
  {
      do // does the given unary functor to elements 
      {  //from starting iterator 'til the end.
          fun(*begin);
          begin = begin.next();
      }while(begin.hasNext());
  
      fun(*begin);
  }
  </code></pre>
  
  <p>And caller:</p>
  
  <pre><code>  for_each(c.iterator(), [&amp;](E&amp; e){add(e);});
  </code></pre>
  
  <p>I except achieve this function call with lambda expression. But compiler says "error: no matching function for call to .."    </p>