Skip to content

Commit 807cde9

Browse files
committed
.
1 parent 40e3d37 commit 807cde9

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

Advanced-Cpp-Programming.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
<ClInclude Include="Template Classes and Functions\Template-class.h" />
135135
</ItemGroup>
136136
<ItemGroup>
137-
<ClCompile Include="Cpp%2711 New features\Object-initialization-default-delete.cpp" />
137+
<ClCompile Include="Cpp%2711 New features\Lambda-expression.cpp" />
138138
<ClCompile Include="Operator Overloading\Complex.cpp" />
139139
</ItemGroup>
140140
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

Advanced-Cpp-Programming.vcxproj.filters

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<ClCompile Include="Operator Overloading\Complex.cpp">
3333
<Filter>Source Files</Filter>
3434
</ClCompile>
35-
<ClCompile Include="Cpp%2711 New features\Object-initialization-default-delete.cpp">
35+
<ClCompile Include="Cpp%2711 New features\Lambda-expression.cpp">
3636
<Filter>Source Files</Filter>
3737
</ClCompile>
3838
</ItemGroup>

Cpp'11 New features/Lambda-expression.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,21 @@
55

66
using namespace std;
77

8+
void test(void(*pfunc)()) {
9+
pfunc();
10+
}
11+
812
int main() {
913

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);
1021

22+
test([]() {cout << "Not being called by a name" << endl; });
23+
1124
return 0;
1225
}

0 commit comments

Comments
 (0)