From c50a0eac9b03a1c07e404add5f75ebf336899b37 Mon Sep 17 00:00:00 2001 From: Dw9 Date: Mon, 12 Apr 2021 21:20:47 +0800 Subject: [PATCH 1/4] [fix]unique_ptr cannot be caught by Value capture --- book/en-us/03-runtime.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/en-us/03-runtime.md b/book/en-us/03-runtime.md index a3efdf63..46c3a3d0 100644 --- a/book/en-us/03-runtime.md +++ b/book/en-us/03-runtime.md @@ -114,7 +114,7 @@ void lambda_expression_capture() { } ``` -In the above code, `important` is an exclusive pointer that cannot be caught. +In the above code, `important` is an exclusive pointer that cannot be caught by Value capture. At this time we need to transfer it to the rvalue and initialize it in the expression. From 87432886c042589bc5360e83dc14623ae363bc89 Mon Sep 17 00:00:00 2001 From: Dw9 Date: Mon, 12 Apr 2021 21:21:43 +0800 Subject: [PATCH 2/4] =?UTF-8?q?[fix]unique=5Fptr=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E5=BC=95=E7=94=A8=E6=8D=95=E8=8E=B7=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/zh-cn/03-runtime.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/book/zh-cn/03-runtime.md b/book/zh-cn/03-runtime.md index 2c880375..8d0c5045 100644 --- a/book/zh-cn/03-runtime.md +++ b/book/zh-cn/03-runtime.md @@ -102,8 +102,7 @@ int main() { } ``` -在上面的代码中,`important` 是一个独占指针,是不能够被捕获到的,这时候我们需要将其转移为右值, -在表达式中初始化。 +在上面的代码中,important 是一个独占指针,是不能够被“=”按值捕获到的,这时候我们可以将其转移为右值,在表达式中初始化。 ### 泛型 Lambda From 6676a8f78dec8689c33018467f5a645c4d13b874 Mon Sep 17 00:00:00 2001 From: Dw9 <36155473+Dw9@users.noreply.github.com> Date: Tue, 13 Apr 2021 08:39:48 +0800 Subject: [PATCH 3/4] Update book/zh-cn/03-runtime.md Co-authored-by: Changkun Ou --- book/zh-cn/03-runtime.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/zh-cn/03-runtime.md b/book/zh-cn/03-runtime.md index 8d0c5045..87612c17 100644 --- a/book/zh-cn/03-runtime.md +++ b/book/zh-cn/03-runtime.md @@ -102,7 +102,7 @@ int main() { } ``` -在上面的代码中,important 是一个独占指针,是不能够被“=”按值捕获到的,这时候我们可以将其转移为右值,在表达式中初始化。 +在上面的代码中,important 是一个独占指针,是不能够被 "=" 值捕获到,这时候我们可以将其转移为右值,在表达式中初始化。 ### 泛型 Lambda From ca3eacef8dc6fab49ead186ac3ff16afbb52076a Mon Sep 17 00:00:00 2001 From: Dw9 <36155473+Dw9@users.noreply.github.com> Date: Tue, 13 Apr 2021 08:40:00 +0800 Subject: [PATCH 4/4] Update book/en-us/03-runtime.md Co-authored-by: Changkun Ou --- book/en-us/03-runtime.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/en-us/03-runtime.md b/book/en-us/03-runtime.md index 46c3a3d0..3a10ac53 100644 --- a/book/en-us/03-runtime.md +++ b/book/en-us/03-runtime.md @@ -114,7 +114,7 @@ void lambda_expression_capture() { } ``` -In the above code, `important` is an exclusive pointer that cannot be caught by Value capture. +In the above code, `important` is an exclusive pointer that cannot be caught by value capture using `=`. At this time we need to transfer it to the rvalue and initialize it in the expression.