title: C++11 lambda function won't accept class method
body: <p>I am probably doing something wrong. Can someone please explain to me what exactly?</p>
  
  <p>Somewhere in class SemanticNodeFactory, I have:</p>
  
  <pre><code>    std::pair&lt;C_ptr,R_ptr&gt; Find( Token token  )
      {
        C_ptr concept = nullptr;
        R_ptr relation = nullptr;
  
        //concept = concept_map-&gt;Find( token ); &lt;- This works
        //relation = relation_map-&gt;Find( token ); &lt;- And this too
  
        std::thread t1 ( [&amp;concept,this] ( Token token ) { concept = concept_map-&gt;Find( token ); } );
        std::thread t2 ( [&amp;relation,this] ( Token token ) { relation = relation_map-&gt;Find( token ); } );
  </code></pre>
  
  <p>The actual methods being called belong to:</p>
  
  <pre><code>typedef std::shared_ptr&lt;Relation&gt; R_ptr;
  typedef std::shared_ptr&lt;Concept&gt;  C_ptr;
  
  std::shared_ptr&lt;SemanticGraph&lt;Relation&gt;&gt; relation_map;
  std::shared_ptr&lt;SemanticGraph&lt;Concept&gt;&gt;  concept_map;
  </code></pre>
  
  <p>However, the compiler complains that:</p>
  
  <pre><code>error: no match for call to ‘(SemanticNodeFactory::Find(Token)::&lt;lambda(Token)&gt;) ()’
  note: candidate is:
  note: SemanticNodeFactory::Find(Token)::&lt;lambda(Token)&gt;
  </code></pre>
  
  <p>However, the actual methods I'm trying to call, are in fact:</p>
  
  <pre><code>SemanticGraph&lt;Relation&gt;::Find(Token)
  SemanticGraph&lt;Concept&gt;::Find(Token)
  </code></pre>
  
  <p>What am I doing wrong?
  I'm capturing this, the local variables by reference, and yet it seems to complain about the actual method?</p>