由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - C++ Q71: overloading (skillport)
相关主题
相关话题的讨论汇总
话题: binary话题: when话题: operator话题: object话题: skillport
进入JobHunting版参与讨论
1 (共1页)
c**********e
发帖数: 2007
1
When can binary operators be declared as member functions?
a) when the left argument of a binary operator is an object of that class.
b) when the right argument of a binary operator is an object of that class.
c) when both arguments of a binary operator is an object of that class.
a****o
发帖数: 686
2
a)

【在 c**********e 的大作中提到】
: When can binary operators be declared as member functions?
: a) when the left argument of a binary operator is an object of that class.
: b) when the right argument of a binary operator is an object of that class.
: c) when both arguments of a binary operator is an object of that class.

c**********e
发帖数: 2007
3
The answer is a). But why c) is not correct?

【在 a****o 的大作中提到】
: a)
M********5
发帖数: 715
4
c的限制太宽了
举一个很简单的例子,你定义一个BigInt,你的类应该是允许 BigInt + int的,而不
是只允许BigInt + BigInt的
1 (共1页)
进入JobHunting版参与讨论
相关主题
相关话题的讨论汇总
话题: binary话题: when话题: operator话题: object话题: skillport