This commit is contained in:
Sergey Zubkov
2019-07-23 09:10:19 -04:00
parent af69b85e10
commit d35d76c3e3

View File

@@ -3744,7 +3744,7 @@ This should be enforced by tooling by checking the return expression .
##### Reason ##### Reason
Functions can't capture local variables or be declared at local scope; if you need those things, prefer a lambda where possible, and a handwritten function object where not. On the other hand, lambdas and function objects don't overload; if you need to overload, prefer a function (the workarounds to make lambdas overload are ornate). If either will work, prefer writing a function; use the simplest tool necessary. Functions can't capture local variables or be defined at local scope; if you need those things, prefer a lambda where possible, and a handwritten function object where not. On the other hand, lambdas and function objects don't overload; if you need to overload, prefer a function (the workarounds to make lambdas overload are ornate). If either will work, prefer writing a function; use the simplest tool necessary.
##### Example ##### Example