title: What does const lambda mean?
body: <pre><code>#include &lt;iostream&gt;
  int foo(int i)
  {
      const auto a = [&amp;i](){ i = 7; return i * i; };
      a();
      return i;
  }
  int main()
  {
      std::cout &lt;&lt; foo(42) &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  <p>This compiles( <code>g++ -std=c++11 -Wall -Wextra -Wpedantic main.cpp</code> ) and returns <code>49</code>. Which is surprising to me, because by declaring <code>a</code> to be a constant object, I would have expected <code>i</code> to be referenced as <code>const int&amp;</code>. It clearly isn't, why?</p>