Skip to content

Commit 8604e6c

Browse files
ibyte2011changkun
authored andcommitted
fix: comments (changkun#56)
修改注释 :引用的右值-->常量引用
1 parent edb8470 commit 8604e6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

code/3/3.3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ int main()
2525
std::cout << rv1 << std::endl; // string,
2626

2727
const std::string& lv2 = lv1 + lv1; // 合法, 常量左值引用能够延长临时变量的申明周期
28-
// lv2 += "Test"; // 非法, 引用的右值无法被修改
28+
// lv2 += "Test"; // 非法, 常量引用无法被修改
2929
std::cout << lv2 << std::endl; // string,string
3030

3131
std::string&& rv2 = lv1 + lv2; // 合法, 右值引用延长临时对象声明周期

0 commit comments

Comments
 (0)