重载运算符 meaning in English
overloaded operator
Examples
- Operator overloading is useful in cases where it is immediately obvious what the result of the operation will be
当重载运算符后运算结果非常直观的情况下才适于进行运算符重载。 - When a type is immutable , meaning the data contained in the instance cannot be changed , overloading operator
当类型不可变时,意味着实例中包含的数据不可更改,此时通过重载运算符 - This solution illustrates the concepts and usage of overloaded operators , using u . s . dollars and euros as an example
此解决方案以美元和欧元为例,演示了重载运算符的概念和用法。 - To overload an operator on a custom class requires creating a method on the class with the correct signature
若要在自定义类中重载运算符,您需要在该类中创建具有正确签名的方法。