tmp/tmpvpkl2hsz/{from.md → to.md}
RENAMED
|
@@ -1,24 +1,29 @@
|
|
| 1 |
#### Subscripting <a id="expr.sub">[[expr.sub]]</a>
|
| 2 |
|
| 3 |
-
A
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
-
|
|
|
|
| 1 |
#### Subscripting <a id="expr.sub">[[expr.sub]]</a>
|
| 2 |
|
| 3 |
+
A *subscript expression* is a postfix expression followed by square
|
| 4 |
+
brackets containing a possibly empty, comma-separated list of
|
| 5 |
+
*initializer-clause*s that constitute the arguments to the subscript
|
| 6 |
+
operator. The *postfix-expression* and the initialization of the object
|
| 7 |
+
parameter of any applicable subscript operator function is sequenced
|
| 8 |
+
before each expression in the *expression-list* and also before any
|
| 9 |
+
default argument. The initialization of a non-object parameter of a
|
| 10 |
+
subscript operator function `S` [[over.sub]], including every associated
|
| 11 |
+
value computation and side effect, is indeterminately sequenced with
|
| 12 |
+
respect to that of any other non-object parameter of `S`.
|
| 13 |
|
| 14 |
+
With the built-in subscript operator, an *expression-list* shall be
|
| 15 |
+
present, consisting of a single *assignment-expression*. One of the
|
| 16 |
+
expressions shall be a glvalue of type “array of `T`” or a prvalue of
|
| 17 |
+
type “pointer to `T`” and the other shall be a prvalue of unscoped
|
| 18 |
+
enumeration or integral type. The result is of type “`T`”. The type
|
| 19 |
+
“`T`” shall be a completely-defined object type.[^11]
|
| 20 |
|
| 21 |
+
The expression `E1[E2]` is identical (by definition) to `*((E1)+(E2))`,
|
| 22 |
+
except that in the case of an array operand, the result is an lvalue if
|
| 23 |
+
that operand is an lvalue and an xvalue otherwise.
|
| 24 |
+
|
| 25 |
+
[*Note 1*: Despite its asymmetric appearance, subscripting is a
|
| 26 |
commutative operation except for sequencing. See [[expr.unary]] and
|
| 27 |
[[expr.add]] for details of `*` and `+` and [[dcl.array]] for details
|
| 28 |
of array types. — *end note*]
|
| 29 |
|
|
|
|
|
|
|
|
|