mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
Update cppguide.html
Make an example with a lambda compilable.
This commit is contained in:
parent
15f2836d9f
commit
b295749688
|
@ -5220,7 +5220,7 @@ lists like other comma-separated lists.</p>
|
||||||
<p>For by-reference captures, do not leave a space between the
|
<p>For by-reference captures, do not leave a space between the
|
||||||
ampersand (&) and the variable name.</p>
|
ampersand (&) and the variable name.</p>
|
||||||
<pre>int x = 0;
|
<pre>int x = 0;
|
||||||
auto x_plus_n = [&x](int n) -> int { return x + n; }
|
auto x_plus_n = [&x](int n) -> int { return x + n; };
|
||||||
</pre>
|
</pre>
|
||||||
<p>Short lambdas may be written inline as function arguments.</p>
|
<p>Short lambdas may be written inline as function arguments.</p>
|
||||||
<pre>std::set<int> blacklist = {7, 8, 9};
|
<pre>std::set<int> blacklist = {7, 8, 9};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user