Number of arguments in operator overload in C++

前端 未结 5 1469
梦如初夏
梦如初夏 2021-01-31 04:09

I\'m learning C++ and I created two simple hello-world applications. In both of them I use operator overload, but here is the problem. On the first one, I can provide two argume

5条回答
  •  时光说笑
    2021-01-31 05:12

    e1 + e2 == e1.operator+(e2) this means e1 is a object and operator+ is a member and e2 is as a variable .basicaly oops permits us to do just write e1 + e2 compiler automatically understand as a e1.operator+(e1)

提交回复
热议问题