From 7f46de1a6c702d95bc76118bf8e8e6a36e007a85 Mon Sep 17 00:00:00 2001 From: Killer_Quinn <51754303+Certseeds@users.noreply.github.com> Date: Sat, 14 Aug 2021 19:27:16 +0800 Subject: [PATCH] book: typo fixes (#204) --- book/en-us/03-runtime.md | 2 +- book/zh-cn/03-runtime.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/book/en-us/03-runtime.md b/book/en-us/03-runtime.md index 907c112..878c127 100644 --- a/book/en-us/03-runtime.md +++ b/book/en-us/03-runtime.md @@ -345,7 +345,7 @@ int main() const std::string& lv2 = lv1 + lv1; // legal, const lvalue reference can extend temp variable's lifecycle // lv2 += "Test"; // illegal, const ref can't be modified - std::cout << lv2 << std::endl; // string,string + std::cout << lv2 << std::endl; // string,string, std::string&& rv2 = lv1 + lv2; // legal, rvalue ref extend lifecycle rv2 += "string"; // legal, non-const reference can be modified diff --git a/book/zh-cn/03-runtime.md b/book/zh-cn/03-runtime.md index debfd6e..3738bc1 100644 --- a/book/zh-cn/03-runtime.md +++ b/book/zh-cn/03-runtime.md @@ -293,7 +293,7 @@ int main() const std::string& lv2 = lv1 + lv1; // 合法, 常量左值引用能够延长临时变量的生命周期 // lv2 += "Test"; // 非法, 常量引用无法被修改 - std::cout << lv2 << std::endl; // string,string + std::cout << lv2 << std::endl; // string,string, std::string&& rv2 = lv1 + lv2; // 合法, 右值引用延长临时对象生命周期 rv2 += "Test"; // 合法, 非常量引用能够修改临时变量