title: using lambda expression and find_if on a collection
body: <p>I have a container object :</p>
  
  <pre><code>R Container;
  </code></pre>
  
  <p>R is of type <code>list&lt;T*&gt;</code> or <code>vector&lt;T*&gt;</code></p>
  
  <p>I am trying to write the following function:</p>
  
  <pre><code>template&lt;typename T, typename R&gt;
  T&amp; tContainer_t&lt;T, R&gt;::Find( T const item ) const
  {   
  typename R::const_iterator it = std::find_if(Container.begin(), Container.end(),  [item](const R&amp;v) { return item == v; });
  if (it != Container.end())
      return (**it);
  else
      throw Exception("Item not found in container");
  }
  </code></pre>
  
  <p>When trying the method (v is an object of my class)</p>
  
  <pre><code>double f = 1.1;
  v.Find(f);
  </code></pre>
  
  <p>I get <code>binary '==' : no operator found which takes a left-hand operand of type 'const double' (or there is no acceptable conversion)</code></p>
  
  <p>I am confused with the lambda expression syntax and what i should write there and couldn't find any friendly explanation.</p>
  
  <p>What is wrong ? 10x.</p>