不能在相等运算符的重载实现中使用默认相等运算符。
You cannot use the default equality operator in an overloaded implementation of the equality operator.
运算符重载允许创建与语言无缝集成的新数据类型。
Operator overloading allows new data types to be created that seamlessly integrate into the language.
尤其是运算符重载,这种情况出现的时候。
运算符重载——对运算符进行重载可以使DSL可以提供一个更为自然的语法。
Operator overloading - overloading operator allows the DSL to provide a natural syntax.
函数重载和运算符重载的两种松软的东西——有许多面向对象的语言不支持这2种特征。
Function overloading and operator overloading are two such fluffy things - there are many OO languages that don't support those 2 features.
一方面为一个类重载运算符增加了代码的物流和可读性。
On one hand overloading operators for a class you have created can help with logistics and readability of code.
如果编程语言支持运算符重载,则还应提供等号和不等号运算符的实现。
If your programming language supports operator overloading, you should also provide an implementation of the equality and inequality operators.
讨论运算符重载的更改。
描述重载运算符的准则。
若要在自定义类中重载运算符,您需要在该类中创建具有正确签名的方法。
To overload an operator on a custom class requires creating a method on the class with the correct signature.
他在大多数情况下都是对的,我要这么说的原因是,通过运算符重载我可以,用一个通用的借口对。
The reason I say that is, by having operator overloading I can use 1 generic interface to all of the objects that I want to use.
重载二元运算符时,也会隐式重载相应的赋值运算符(如果有)。
When a binary operator is overloaded, the corresponding assignment operator, if any, is also implicitly overloaded.
重载二元运算符时,也会隐式重载相应的赋值运算符(如果有)。
When a binary operator is overloaded, the corresponding assignment operator, if any, is also implicitly overloaded.
应用推荐