读书人

内置类型的赋值演算返回对右(还是左?

发布时间: 2012-08-22 09:50:34 作者: rapoo

内置类型的赋值运算返回对右(还是左??)操作数的引用

C/C++ code
The return type from the assignment operator should be the same as the return from assignment for the built-in types (Section 5.4.1, p. 160). Assignment to a built-in type returns a reference to its left-hand operand. Therefore, the assignment operator also returns a reference to the same type as its class.赋值操作符的返回类型应该与内置类型赋值运算返回的类型相同(第 5.4.1 节)。内置类型的赋值运算返回对[color=#FF0000]右[/color]操作数的引用,因此,赋值操作符也返回对同一类类型的引用。

C++primer 中文版 P411写的是“内置类型的赋值运算返回对右操作数的引用”。

“left-hand operand.”这个是做操作数吧,什么情况?

[解决办法]
returns a reference to its left-hand operand
left是左,这段话里哪有右了

读书人网 >C++

热点推荐