From ad4b9580a51082acc83eba88a0207b44e3228d7b Mon Sep 17 00:00:00 2001 From: Dw9 <36155473+Dw9@users.noreply.github.com> Date: Tue, 13 Apr 2021 15:36:31 +0800 Subject: [PATCH] book: rephrease unique_ptr value capturing (#182) --- book/en-us/03-runtime.md | 2 +- book/zh-cn/03-runtime.md | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/book/en-us/03-runtime.md b/book/en-us/03-runtime.md index a3efdf6..3a10ac5 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 using `=`. At this time we need to transfer it to the rvalue and initialize it in the expression. diff --git a/book/zh-cn/03-runtime.md b/book/zh-cn/03-runtime.md index 2c88037..87612c1 100644 --- a/book/zh-cn/03-runtime.md +++ b/book/zh-cn/03-runtime.md @@ -102,8 +102,7 @@ int main() { } ``` -在上面的代码中,`important` 是一个独占指针,是不能够被捕获到的,这时候我们需要将其转移为右值, -在表达式中初始化。 +在上面的代码中,important 是一个独占指针,是不能够被 "=" 值捕获到,这时候我们可以将其转移为右值,在表达式中初始化。 ### 泛型 Lambda