Skip to content

Commit ad4b958

Browse files
authored
book: rephrease unique_ptr value capturing (changkun#182)
1 parent 5e25310 commit ad4b958

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

book/en-us/03-runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void lambda_expression_capture() {
114114
}
115115
```
116116

117-
In the above code, `important` is an exclusive pointer that cannot be caught.
117+
In the above code, `important` is an exclusive pointer that cannot be caught by value capture using `=`.
118118
At this time we need to transfer it to the rvalue and
119119
initialize it in the expression.
120120

book/zh-cn/03-runtime.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ int main() {
102102
}
103103
```
104104

105-
在上面的代码中,`important` 是一个独占指针,是不能够被捕获到的,这时候我们需要将其转移为右值,
106-
在表达式中初始化。
105+
在上面的代码中,important 是一个独占指针,是不能够被 "=" 值捕获到,这时候我们可以将其转移为右值,在表达式中初始化。
107106

108107
### 泛型 Lambda
109108

0 commit comments

Comments
 (0)