You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/en-us/03-runtime.md
+6-10Lines changed: 6 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -126,13 +126,9 @@ initialize it in the expression.
126
126
127
127
In the previous section, we mentioned that the `auto` keyword cannot be used
128
128
in the parameter list because it would conflict with the functionality of the template.
129
-
But Lambda expressions are not ordinary functions, so Lambda expressions are not templated.
130
-
This has caused us some trouble: the parameter table cannot be generalized,
131
-
and the parameter table type must be clarified.
132
-
133
-
Fortunately, this trouble only exists in C++11, starting with C++14.
134
-
The formal parameters of the Lambda function can use the `auto` keyword
135
-
to generate generic meanings:
129
+
But lambda expressions are not regular functions, without further specification on the typed parameter list, lambda expressions cannot utilize templates. Fortunately, this trouble
130
+
only exists in C++11, starting with C++14. The formal parameters of the lambda function
131
+
can use the `auto` keyword to utilize template generics:
136
132
137
133
```cpp
138
134
voidlambda_generic() {
@@ -221,7 +217,7 @@ int foo(int a, int b, int c) {
221
217
;
222
218
}
223
219
int main() {
224
-
// bind parameter 1, 2 on function foo,
220
+
// bind parameter 1, 2 on function foo,
225
221
// and use std::placeholders::_1 as placeholder for the first parameter.
226
222
auto bindFoo = std::bind(foo, std::placeholders::_1, 1,2);
0 commit comments