此外还有重载操作符(Overloading Operator),它是对基本操作符作了重新定义的函数型操作符。各种操作符所要求的操作数的类型详见表3.2,操作符之间的优先级别见表3.3。
基于42个网页-相关网页
大多数重载操作符可以定义为普通非成员函数或类的成员函数。
Most overloaded operators may be defined as ordinary nonmember functions or as class member functions.
可以看出,Groovy的算术类重载操作符不仅能负重,而且能做得很快!
As you can see, Groovy's math-like overload operators can not only bear quite a load, but they can do it apace!
这条规则强制重载操作符不能重新定义用于内置类型对象的操作符的含义。
This rule enforces the requirement that an overloaded operator may not redefine the meaning of the operators when applied to objects of built-in type.
OK, in each case, what these things are doing, is they're doing, what sometimes gets referred to as operator overloading.
这将会是个默认的或者说是,通用的来比较对象是否相同的方法,好,在每个例子中,这些事情正在做的,就是,一些与操作符重载有关的东西。
So there are some downsides, in my view, to doing operator overloading, but there's some real pluses.
它还可以应用于其他一些东西,因此这样做操作符重载,就会产生一些负面影响了,以我的观点来看的话。
Because this is overloading that multiplication operator with two different tasks.
因为这会造成使得乘法操作符,对两种不同的任务造成重载。
应用推荐