Rules of operator overloading 运算符重载的规则
That was the first time I was introduced to the concept of operator overloading.
这是我第一次被介绍给了操作符重载的概念。
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时曾问过他为何放弃操作符重载(我想该问题和答案还尚未公开过)。
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.
他在大多数情况下都是对的,我要这么说的原因是,通过运算符重载我可以,用一个通用的借口对。
应用推荐