How is x ++ different from ++ x?

I am currently studying Dynamics AX 2012 X ++ developer e-learning and asking a question about the X ++ language, which is not obvious from the documentation.

In one place it is said that x++they are ++xexactly the same. However, it also has this statement, which states the priority of the operator :

  • postfix operators []. (params) expr ++ expr -

  • unary operators ++ expr - expr + expr - expr ~!

That is, they are equivalent, except for the priority of the operator, or do I not understand something?

Or the fact that ++ / - is used only in operators, and not in expressions, completely displays all this irrelevant ?

+4
source share
1 answer

According to the X ++ documentation. The operator "++" can only be used as an operator. This restriction effectively exceeds any operator precedence rules. My interpretation is that the “++” operator was included in the X ++ prioritization documentation for completeness.

+7
source

Source: https://habr.com/ru/post/1545748/


All Articles