title: Lambda function capture a variable vs return value?
body: <p>I am learning c++11 new function lambda function and am a little confused.
  I read that</p>
  
  <pre><code> []         Capture nothing (or, a scorched earth strategy?)
   [&amp;]        Capture any referenced variable by reference
   [=]        Capture any referenced variable by making a copy
   [=, &amp;foo]  Capture any referenced variable by making a copy, but capture variable foo by reference
   [bar]      Capture bar by making a copy; don't copy anything else
   [this]     Capture the this pointer of the enclosing class
  </code></pre>
  
  <p>My question is what exactly does capture a variable mean and what's the difference with return a value, if you want to capture a variable you have to return it right?</p>
  
  <p>For example:</p>
  
  <pre><code>[] () { int a = 2; return a; } 
  </code></pre>
  
  <p>Why is it not</p>
  
  <pre><code>int [] () { int a = 2; return a; }
  </code></pre>