title: C++ Lambdas: Difference between "mutable" and capture-by-reference
body: <p>In C++ you can declare lambdas for example like this:</p>
  
  <pre><code>int x = 5;
  auto a = [=]() mutable { ++x; std::cout &lt;&lt; x &lt;&lt; '\n'; };
  auto b = [&amp;]()         { ++x; std::cout &lt;&lt; x &lt;&lt; '\n'; };
  </code></pre>
  
  <p>Both let me modify <code>x</code>, so what is the difference?</p>