C++ style guide: Difference between revisions

Jump to navigation Jump to search
Add section for lambda expressions
m (Add section on new/delete keywords)
(Add section for lambda expressions)
 
Line 346: Line 346:
</syntaxhighlight>
</syntaxhighlight>
|}
|}
=== lambda expressions ===
When capturing variables from the surrounding function, explicitly list the variables being captured rather than relying on a default capture by value (`[=]`) or by reference (`[&]`).  This more clearly captures the programmer's intent and makes the code more understandable.


=== std::string ===
=== std::string ===
1,072

edits

Navigation menu