File tree 3 files changed +15
-2
lines changed
3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 134
134
<ClInclude Include =" Template Classes and Functions\Template-class.h" />
135
135
</ItemGroup >
136
136
<ItemGroup >
137
- <ClCompile Include =" Cpp%2711 New features\Object-initialization-default-delete .cpp" />
137
+ <ClCompile Include =" Cpp%2711 New features\Lambda-expression .cpp" />
138
138
<ClCompile Include =" Operator Overloading\Complex.cpp" />
139
139
</ItemGroup >
140
140
<Import Project =" $(VCTargetsPath)\Microsoft.Cpp.targets" />
Original file line number Diff line number Diff line change 32
32
<ClCompile Include =" Operator Overloading\Complex.cpp" >
33
33
<Filter >Source Files</Filter >
34
34
</ClCompile >
35
- <ClCompile Include =" Cpp%2711 New features\Object-initialization-default-delete .cpp" >
35
+ <ClCompile Include =" Cpp%2711 New features\Lambda-expression .cpp" >
36
36
<Filter >Source Files</Filter >
37
37
</ClCompile >
38
38
</ItemGroup >
Original file line number Diff line number Diff line change 5
5
6
6
using namespace std ;
7
7
8
+ void test (void (*pfunc)()) {
9
+ pfunc ();
10
+ }
11
+
8
12
int main () {
9
13
14
+ auto func = []() {cout << " Being called by a name" << endl; };
15
+
16
+ func ();
17
+
18
+ []() {cout << " Not being called by a name" << endl; }();
19
+
20
+ test (func);
10
21
22
+ test ([]() {cout << " Not being called by a name" << endl; });
23
+
11
24
return 0 ;
12
25
}
You can’t perform that action at this time.
0 commit comments