How is the expression x---y parsed? Is it a legal expression?

后端 未结 4 1260
失恋的感觉
失恋的感觉 2020-12-20 23:25

How is the expression x---y parsed? Is it a legal expression?

4条回答
  •  遥遥无期
    2020-12-21 00:24

    For all data types, it's parsed as x-- - y. If it's some class object then you have to define post decrement operator and minus operator, it will give compiler error if you just define pre decrement operator. That means, x-- - y is forced in any case.

提交回复
热议问题