mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 04:34:40 +03:00
revision: #2: 增加随书代码说明
This commit is contained in:
BIN
code/1/1.1
BIN
code/1/1.1
Binary file not shown.
@@ -12,6 +12,7 @@
|
||||
#include <functional>
|
||||
|
||||
int main() {
|
||||
// 使用 lambda 表达式
|
||||
[out = std::ref(std::cout << "Result from C code: " << add(1, 2))](){
|
||||
out.get() << ".\n";
|
||||
}();
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "foo.h"
|
||||
|
||||
// C 语言代码
|
||||
int add(int x, int y) {
|
||||
return x+y;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user