Jon Jagger
jon@jaggersoft.com
Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specificationpreviousnextprevious at this levelnext at this level 14 Expressionsprevious at this levelnext at this level 14.5 Primary expressionsprevious at this levelnext at this level 14.5.9 Postfix increment and decrement operatorspost-increment-expression : primary-expression ++ post-decrement-expression : primary-expression -- Paragraph 11 The operand of a postfix increment or decrement operation must be an expression classified as a variable, a property access, or an indexer access. 2 The result of the operation is a value of the same type as the operand. Paragraph 21 If the operand of a postfix increment or decrement operation is a property or indexer access, the property or indexer must have both a get and a set accessor. 2 If this is not the case, a compile-time error occurs. Paragraph 31 Unary operator overload resolution (§14.2.3) is applied to select a specific operator implementation. 2 Predefined ++ and --operators exist for the following types: sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, decimal, and any enum type. 3 The predefined ++ operators return the value produced by adding 1 to the operand, and the predefined --operators return the value produced by subtracting 1 from the operand. Paragraph 41 The run-time processing of a postfix increment or decrement operation of the form x++ or x--consists of the following steps: Paragraph 51 The ++ and --operators also support prefix notation (§14.6.5). 2 The result of x++ or x--is the value of x before the operation, whereas the result of ++x or --x is the value of x after the operation. 3 In either case, x itself has the same value after the operation. Paragraph 61 An operator ++ or operator --implementation can be invoked using either postfix or prefix notation. 2 It is not possible to have separate operator implementations for the two notations.
{ JSL }
Jagger Software Ltd
Company # 4070126
VAT # 762 5213 42
Valid HTML 4.01Valid CSS