tmp/tmpe88v5x5u/{from.md → to.md}
RENAMED
|
@@ -1,31 +1,29 @@
|
|
| 1 |
-
## Comma operator <a id="expr.comma">[[expr.comma]]</a>
|
| 2 |
|
| 3 |
The comma operator groups left-to-right.
|
| 4 |
|
| 5 |
``` bnf
|
| 6 |
expression:
|
| 7 |
assignment-expression
|
| 8 |
expression ',' assignment-expression
|
| 9 |
```
|
| 10 |
|
| 11 |
A pair of expressions separated by a comma is evaluated left-to-right;
|
| 12 |
-
the left expression is a discarded-value expression
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
operand is a bit-field. If the right operand is a temporary expression (
|
| 19 |
-
[[class.temporary]]), the result is a temporary expression.
|
| 20 |
|
| 21 |
In contexts where comma is given a special meaning,
|
| 22 |
|
| 23 |
-
[*Example 1*: in lists of arguments to functions
|
| 24 |
-
lists of initializers
|
| 25 |
|
| 26 |
-
the comma operator as described in
|
| 27 |
parentheses.
|
| 28 |
|
| 29 |
[*Example 2*:
|
| 30 |
|
| 31 |
``` cpp
|
|
@@ -34,5 +32,9 @@ f(a, (t=3, t+2), c);
|
|
| 34 |
|
| 35 |
has three arguments, the second of which has the value `5`.
|
| 36 |
|
| 37 |
— *end example*]
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Comma operator <a id="expr.comma">[[expr.comma]]</a>
|
| 2 |
|
| 3 |
The comma operator groups left-to-right.
|
| 4 |
|
| 5 |
``` bnf
|
| 6 |
expression:
|
| 7 |
assignment-expression
|
| 8 |
expression ',' assignment-expression
|
| 9 |
```
|
| 10 |
|
| 11 |
A pair of expressions separated by a comma is evaluated left-to-right;
|
| 12 |
+
the left expression is a discarded-value expression [[expr.prop]]. The
|
| 13 |
+
left expression is sequenced before the right expression
|
| 14 |
+
[[intro.execution]]. The type and value of the result are the type and
|
| 15 |
+
value of the right operand; the result is of the same value category as
|
| 16 |
+
its right operand, and is a bit-field if its right operand is a
|
| 17 |
+
bit-field.
|
|
|
|
|
|
|
| 18 |
|
| 19 |
In contexts where comma is given a special meaning,
|
| 20 |
|
| 21 |
+
[*Example 1*: in lists of arguments to functions [[expr.call]] and
|
| 22 |
+
lists of initializers [[dcl.init]] — *end example*]
|
| 23 |
|
| 24 |
+
the comma operator as described in this subclause can appear only in
|
| 25 |
parentheses.
|
| 26 |
|
| 27 |
[*Example 2*:
|
| 28 |
|
| 29 |
``` cpp
|
|
|
|
| 32 |
|
| 33 |
has three arguments, the second of which has the value `5`.
|
| 34 |
|
| 35 |
— *end example*]
|
| 36 |
|
| 37 |
+
[*Note 1*: A comma expression appearing as the
|
| 38 |
+
*expr-or-braced-init-list* of a subscripting expression [[expr.sub]] is
|
| 39 |
+
deprecated; see [[depr.comma.subscript]]. — *end note*]
|
| 40 |
+
|