Browse Source

lambda style

Former-commit-id: 5a56c0d8d985c4ee020c70de9b2bfb932ef21748
Alec Jacobson 9 years ago
parent
commit
7bc7e07423
1 changed files with 6 additions and 2 deletions
  1. 6 2
      style-guidelines.md

+ 6 - 2
style-guidelines.md

@@ -94,7 +94,12 @@ new pair of .h/.cpp files with this sub-function.
 
 
 If encapsulation in a separate file is not possible or does not make sense,
 If encapsulation in a separate file is not possible or does not make sense,
 then avoid crowding the namespace by creating lambda functions within the
 then avoid crowding the namespace by creating lambda functions within the
-function implmentation.
+function implementation.
+
+These lambda functions must still be documented with clear [input and output
+arguments](#headerdocumentation). Avoid using full capturing of all automatic
+variables: do not use `[&]` or `[=]`. Rather specify each captured variable
+individually.
 
 
 ### Avoid "helper" classes
 ### Avoid "helper" classes
 
 
@@ -104,7 +109,6 @@ pass "basic types" directly. The price we pay is long function interfaces, but
 this increases code reuse dramatically. A "basic type" in our context is a
 this increases code reuse dramatically. A "basic type" in our context is a
 Eigen type, stl type, or basic C type.
 Eigen type, stl type, or basic C type.
 
 
-
 ## Header Documentation
 ## Header Documentation
 
 
 Each function prototype should be well documented in its corresponding .h
 Each function prototype should be well documented in its corresponding .h