We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2745fc3 commit 6f6531fCopy full SHA for 6f6531f
book/zh-cn/03-runtime.md
@@ -236,7 +236,7 @@ void reference(std::string&& str) {
236
int main()
237
{
238
std::string lv1 = "string,"; // lv1 是一个左值
239
- // std::string&& r1 = s1; // 非法, 右值引用不能引用左值
+ // std::string&& r1 = lv1; // 非法, 右值引用不能引用左值
240
std::string&& rv1 = std::move(lv1); // 合法, std::move可以将左值转移为右值
241
std::cout << rv1 << std::endl; // string,
242
0 commit comments