mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 04:34:40 +03:00
revision #1: 更新第二章中已维护的代码
This commit is contained in:
20
code/1/1.1.c.and.cpp
Normal file
20
code/1/1.1.c.and.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// 1.1.cpp
|
||||
//
|
||||
// chapter 1 introduction
|
||||
// modern cpp tutorial
|
||||
//
|
||||
// created by changkun at changkun.de
|
||||
//
|
||||
|
||||
#include "foo.h"
|
||||
#include <iostream>
|
||||
#include <functional>
|
||||
|
||||
int main() {
|
||||
// use lambda expression
|
||||
[out = std::ref(std::cout << "Result from C code: " << add(1, 2))](){
|
||||
out.get() << ".\n";
|
||||
}();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user