Update cppguide.html

Make an example with a lambda compilable.
This commit is contained in:
AleksandrKonstantinov 2017-03-30 10:55:30 +07:00 committed by GitHub
parent 15f2836d9f
commit b295749688

View File

@ -5220,7 +5220,7 @@ lists like other comma-separated lists.</p>
<p>For by-reference captures, do not leave a space between the
ampersand (&amp;) and the variable name.</p>
<pre>int x = 0;
auto x_plus_n = [&amp;x](int n) -&gt; int { return x + n; }
auto x_plus_n = [&amp;x](int n) -&gt; int { return x + n; };
</pre>
<p>Short lambdas may be written inline as function arguments.</p>
<pre>std::set&lt;int&gt; blacklist = {7, 8, 9};