File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 3
3
readability-avoid-default-lambda-capture
4
4
========================================
5
5
6
- Warns on default lambda captures (e.g. ``[&](){ ... } ``, ``[=](){ ... } ``)
6
+ Warns on default lambda captures (e.g. ``[&](){ ... } ``, ``[=](){ ... } ``).
7
7
8
8
Captures can lead to subtle bugs including dangling references and unnecessary
9
9
copies. Writing out the name of the variables being captured reminds programmers
@@ -33,8 +33,8 @@ Example
33
33
}
34
34
35
35
When ``callbacks `` is executed, ``factoryId `` will dangle. Writing the name of
36
- ``factoryId `` in the capture list makes it easy to review the captures and
37
- detect obvious bugs .
36
+ ``factoryId `` in the capture list reminds the reader that it is being captured,
37
+ which will hopefully lead to the bug being fixed during code review .
38
38
39
39
.. code-block :: c++
40
40
You can’t perform that action at this time.
0 commit comments