
14 Expressions
14.13 Assignment operators
14.13.2 Compound assignment
Paragraph 11 An operation of the form x op= y is processed by applying binary operator overload resolution (§14.2.4) as if the operation was written x op y. 2 Then, byte b = 0; char ch = '\0'; int i = 0; b += 1; // Ok b += 1000; // Error, b = 1000 not permitted b += i; // Error, b = i not permitted b += (byte)i; // Ok ch += 1; // Error, ch = 1 not permitted ch += (char)1; // Okthe intuitive reason for each error is that a corresponding simple assignment would also have been an error. end example]
| |
| Jagger Software Ltd | |
| Company # 4070126 | |
| VAT # 762 5213 42 |