From Jason Turner

[expr.sub]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmps79ynx01/{from.md → to.md} +12 -8
tmp/tmps79ynx01/{from.md → to.md} RENAMED
@@ -1,20 +1,24 @@
1
- ### Subscripting <a id="expr.sub">[[expr.sub]]</a>
2
 
3
  A postfix expression followed by an expression in square brackets is a
4
  postfix expression. One of the expressions shall be a glvalue of type
5
  “array of `T`” or a prvalue of type “pointer to `T`” and the other shall
6
  be a prvalue of unscoped enumeration or integral type. The result is of
7
  type “`T`”. The type “`T`” shall be a completely-defined object
8
- type.[^5] The expression `E1[E2]` is identical (by definition) to
9
- `*((E1)+(E2))`
 
 
10
 
11
- [*Note 1*: see  [[expr.unary]] and  [[expr.add]] for details of `*` and
12
- `+` and  [[dcl.array]] for details of arrays. *end note*]
 
13
 
14
- , except that in the case of an array operand, the result is an lvalue
15
- if that operand is an lvalue and an xvalue otherwise. The expression
16
- `E1` is sequenced before the expression `E2`.
 
17
 
18
  A *braced-init-list* shall not be used with the built-in subscript
19
  operator.
20
 
 
1
+ #### Subscripting <a id="expr.sub">[[expr.sub]]</a>
2
 
3
  A postfix expression followed by an expression in square brackets is a
4
  postfix expression. One of the expressions shall be a glvalue of type
5
  “array of `T`” or a prvalue of type “pointer to `T`” and the other shall
6
  be a prvalue of unscoped enumeration or integral type. The result is of
7
  type “`T`”. The type “`T`” shall be a completely-defined object
8
+ type.[^11] The expression `E1[E2]` is identical (by definition) to
9
+ `*((E1)+(E2))`, except that in the case of an array operand, the result
10
+ is an lvalue if that operand is an lvalue and an xvalue otherwise. The
11
+ expression `E1` is sequenced before the expression `E2`.
12
 
13
+ [*Note 1*: A comma expression [[expr.comma]] appearing as the
14
+ *expr-or-braced-init-list* of a subscripting expression is deprecated;
15
+ see [[depr.comma.subscript]]. — *end note*]
16
 
17
+ [*Note 2*: Despite its asymmetric appearance, subscripting is a
18
+ commutative operation except for sequencing. See  [[expr.unary]] and 
19
+ [[expr.add]] for details of `*` and `+` and  [[dcl.array]] for details
20
+ of array types. — *end note*]
21
 
22
  A *braced-init-list* shall not be used with the built-in subscript
23
  operator.
24