book, code: fix typos (#225)

This commit is contained in:
ambiguoustexture
2022-02-25 23:23:03 +08:00
committed by GitHub
parent 847b53632d
commit 1db84fe462
2 changed files with 2 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ void reference(std::string&& str) {
int main()
{
std::string lv1 = "string,"; // lv1 is a lvalue
// std::string&& r1 = s1; // illegal, rvalue can't ref to lvalue
// std::string&& r1 = lv1; // illegal, rvalue can't ref to lvalue
std::string&& rv1 = std::move(lv1); // legal, std::move can convert lvalue to rvalue
std::cout << rv1 << std::endl; // string,