Function overloading and operator overloading are two such fluffy things - there are many OO languages that don't support those 2 features.
函数重载和运算符重载的两种松软的东西——有许多面向对象的语言不支持这2种特征。
As you've seen, operator AD hoc polymorphism, or operator overloading to the rest of us, can be quite powerful if carefully employed and documented.
可以看到,操作符的即时多态,或操作符重载,对于我们来说,如果小心使用和记录,会非常强大。
I remember asking this Gosling in one of my interviews of him why he left out operator overloading (I don't think that question and answer ended up getting published).
我记得在采访Gosling时曾问过他为何放弃操作符重载(我想该问题和答案还尚未公开过)。
And no, contrary to what it might look like, this isn't operator-overloading.
与其外表相反,这并非操作符重载。
If your programming language supports operator overloading, you should also provide an implementation of the equality and inequality operators.
如果编程语言支持运算符重载,则还应提供等号和不等号运算符的实现。
Operator overloading that works well with generics and built-in primitive types.
运算子多载,适用于泛型及内建基本型别。
Operator overloading that works well with generics and built-in primitive types.
运算子多载,适用于泛型及内建基本型别。
应用推荐