title: Referencing of Lambda Parameters in C++/CX
body: <p>I'm new to lambdas and I'm having a hard time understanding how the following lambda expression's parameter list works.</p>
  
  <p>The code is part of a facebook authentication method:</p>
  
  <pre><code>---------------- begin snippet ------------------
  
  auto webAuthenticationOperation = WebAuthenticationBroker::AuthenticateAsync(WebAuthenticationOptions::Default, startURI, endURI);
  
  webAuthenticationOperation-&gt;Completed = ref new AsyncOperationCompletedHandler&lt;WebAuthenticationResult^&gt;([output, facebookOutput, facebookToken](IAsyncOperation&lt;WebAuthenticationResult^&gt;^ thisOperation)
  {
      if (thisOperation-&gt;ErrorCode.Value == 0)
  
  ----------------some other stuff ---------------
  </code></pre>
  
  <p>Specifically, I don't know how <strong>thisOperation</strong> actually refers to the WebAuthenticationResult that's currently being handled.  </p>
  
  <p>I read the block as:</p>
  
  <p>1.) start an async authentication</p>
  
  <p>2.) when the authentication is complete, run a function defined by the lambda</p>
  
  <hr>
  
  <p>But the lambda function needs to know about THIS particular authentication operation (I'm assuming there's some kind of result that's returned to us when its complete).  Based on the lambda's parameter list, it looks like we've just declared a pointer to a web authentication result without actually pointing it at anything.  </p>
  
  <p>How is it that <strong>thisOperation</strong> ends up referencing the correct object?</p>