mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 04:34:40 +03:00
book: typo fixes (#240)
This commit is contained in:
@@ -339,7 +339,7 @@ void reference(std::string&& str) {
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::string lv1 = "string,"; // lv1 is a lvalue
|
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::string&& rv1 = std::move(lv1); // legal, std::move can convert lvalue to rvalue
|
||||||
std::cout << rv1 << std::endl; // string,
|
std::cout << rv1 << std::endl; // string,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user