Why isn't operator overloading for pointers allowed to work?

后端 未结 9 2061
鱼传尺愫
鱼传尺愫 2020-12-03 14:08

As per the comment under this answer, references were introduced primarily to support operator overloading which quotes Bjarne Stroustrup:

References

9条回答
  •  猫巷女王i
    2020-12-03 14:46

    Operator overloading work on objects but pointer is not an object by itself. It points to an object.

提交回复
热议问题