I am not using this code in any production environment, it is just for my understanding. Is this code valid (i.e. can I define my postfix operator like this?):
Yes, it is valid the int as a parameter it only a policy enforcing parameter to distinguish between prefix and postfix operators. The passed parameter will be received as an argument, which is the behavior you see & it is prfectly defined behavior.