fix: comments (#53)

引用的右值-->常量引用
This commit is contained in:
junpeng
2019-01-14 13:31:02 +08:00
committed by Ou Changkun
parent 6c59f0130b
commit edb8470c28

View File

@@ -241,7 +241,7 @@ int main()
std::cout << rv1 << std::endl; // string,
const std::string& lv2 = lv1 + lv1; // 合法, 常量左值引用能够延长临时变量的生命周期
// lv2 += "Test"; // 非法, 引用的右值无法被修改
// lv2 += "Test"; // 非法, 常量引用无法被修改
std::cout << lv2 << std::endl; // string,string
std::string&& rv2 = lv1 + lv2; // 合法, 右值引用延长临时对象生命周期