Groovy supports the following math-like operators for overloading.
Groovy支持以下算术类操作符的重载。
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.
如果编程语言支持运算符重载,则还应提供等号和不等号运算符的实现。
Describes guidelines for overloading operators.
描述重载运算符的准则。
On all compound assignment operators, overloading the binary operator implicitly overloads the equivalent compound assignment.
在所有复合指派运算子上,多载二元运算子即隐含多载对等的复合指派。
On all compound assignment operators, overloading the binary operator implicitly overloads the equivalent compound assignment.
在所有复合指派运算子上,多载二元运算子即隐含多载对等的复合指派。
应用推荐