Skip to content

Commit e202554

Browse files
committed
book: import correct header
Fixes changkun#192 Fixes changkun#147
1 parent 529399f commit e202554

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

book/en-us/03-runtime.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ The type of the captured variable being declared is judged according to the expr
105105
and the judgment is the same as using `auto`:
106106

107107
```cpp
108+
#include <memory>
109+
108110
void lambda_expression_capture() {
109111
auto important = std::make_unique<int>(1);
110112
auto add = [v1 = 1, v2 = std::move(important)](int x, int y) -> int {

book/zh-cn/03-runtime.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ C++14 给与了我们方便,允许捕获的成员用任意的表达式进行
9090

9191
```cpp
9292
#include <iostream>
93-
#include <utility>
93+
#include <memory> // std::make_unique
94+
#include <utility> // std::move
9495

9596
int main() {
9697
auto important = std::make_unique<int>(1);

code/3/3.1.lambda.basic.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010

1111
#include <iostream>
12-
#include <utility>
12+
#include <memory> // std::make_unique
13+
#include <utility> // std::move
1314

1415
void lambda_value_capture() {
1516
int value = 1;

0 commit comments

Comments
 (0)