我的C老师认为标准C中的*运算符“已经重载”,因为它可以意味着依赖于上下文的间接或乘法.他从C Primer Plus获得了这一点,其中指出:
Actually,many C++ (and C) operators already are overloaded. For example,the * operator,when applied to an address,yields the value stored at that address. But applying * to two numbers yields the product of the values. C++ uses the number and type of operands to decide which action to take. (pg 502,5th ed)
至少另外一本教科书说得很一样.据我所知,这是不正确的;一元*是与二进制*不同的运算符,编译器消除它们的机制与运算符重载无关.
谁是对的