tmp/tmp0i0os49r/{from.md → to.md}
RENAMED
|
@@ -6,31 +6,29 @@ end of a replacement list for either form of macro definition.
|
|
| 6 |
If, in the replacement list of a function-like macro, a parameter is
|
| 7 |
immediately preceded or followed by a `##` preprocessing token, the
|
| 8 |
parameter is replaced by the corresponding argument’s preprocessing
|
| 9 |
token sequence; however, if an argument consists of no preprocessing
|
| 10 |
tokens, the parameter is replaced by a placemarker preprocessing token
|
| 11 |
-
instead.[^
|
| 12 |
|
| 13 |
For both object-like and function-like macro invocations, before the
|
| 14 |
replacement list is reexamined for more macro names to replace, each
|
| 15 |
instance of a `##` preprocessing token in the replacement list (not from
|
| 16 |
an argument) is deleted and the preceding preprocessing token is
|
| 17 |
concatenated with the following preprocessing token. Placemarker
|
| 18 |
preprocessing tokens are handled specially: concatenation of two
|
| 19 |
placemarkers results in a single placemarker preprocessing token, and
|
| 20 |
concatenation of a placemarker with a non-placemarker preprocessing
|
| 21 |
-
token results in the non-placemarker preprocessing token.
|
| 22 |
-
begins with a sequence matching the syntax of
|
| 23 |
-
*universal-character-name*, the behavior is undefined.
|
| 24 |
|
| 25 |
-
[*Note 1*:
|
| 26 |
-
|
| 27 |
-
[[lex.phases]]. — *end note*]
|
| 28 |
|
| 29 |
-
If the result is not a valid preprocessing token, the
|
| 30 |
-
|
| 31 |
-
replacement. The order of evaluation of `##` operators is
|
|
|
|
| 32 |
|
| 33 |
[*Example 1*:
|
| 34 |
|
| 35 |
The sequence
|
| 36 |
|
|
@@ -71,12 +69,12 @@ fputs("strncmp(\"abc\\0d\", \"abc\", '\\4') == 0: \@n", s);
|
|
| 71 |
#include "vers2.h" (after macro replacement, before file access)
|
| 72 |
"hello";
|
| 73 |
"hello, world"
|
| 74 |
```
|
| 75 |
|
| 76 |
-
Space around the `#` and `##` tokens in the macro
|
| 77 |
-
optional.
|
| 78 |
|
| 79 |
— *end example*]
|
| 80 |
|
| 81 |
[*Example 2*:
|
| 82 |
|
|
@@ -98,13 +96,13 @@ in_between(x hash_hash y)
|
|
| 98 |
in_between(x ## y)
|
| 99 |
mkstr(x ## y)
|
| 100 |
"x ## y"
|
| 101 |
```
|
| 102 |
|
| 103 |
-
In other words, expanding `hash_hash` produces a new
|
| 104 |
-
of two adjacent sharp signs, but this new
|
| 105 |
-
operator.
|
| 106 |
|
| 107 |
— *end example*]
|
| 108 |
|
| 109 |
[*Example 3*:
|
| 110 |
|
|
|
|
| 6 |
If, in the replacement list of a function-like macro, a parameter is
|
| 7 |
immediately preceded or followed by a `##` preprocessing token, the
|
| 8 |
parameter is replaced by the corresponding argument’s preprocessing
|
| 9 |
token sequence; however, if an argument consists of no preprocessing
|
| 10 |
tokens, the parameter is replaced by a placemarker preprocessing token
|
| 11 |
+
instead.[^7]
|
| 12 |
|
| 13 |
For both object-like and function-like macro invocations, before the
|
| 14 |
replacement list is reexamined for more macro names to replace, each
|
| 15 |
instance of a `##` preprocessing token in the replacement list (not from
|
| 16 |
an argument) is deleted and the preceding preprocessing token is
|
| 17 |
concatenated with the following preprocessing token. Placemarker
|
| 18 |
preprocessing tokens are handled specially: concatenation of two
|
| 19 |
placemarkers results in a single placemarker preprocessing token, and
|
| 20 |
concatenation of a placemarker with a non-placemarker preprocessing
|
| 21 |
+
token results in the non-placemarker preprocessing token.
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
[*Note 1*: Concatenation can form a *universal-character-name*
|
| 24 |
+
[[lex.charset]]. — *end note*]
|
|
|
|
| 25 |
|
| 26 |
+
If the result is not a valid preprocessing token, the program is
|
| 27 |
+
ill-formed. The resulting preprocessing token is available for further
|
| 28 |
+
macro replacement. The order of evaluation of `##` operators is
|
| 29 |
+
unspecified.
|
| 30 |
|
| 31 |
[*Example 1*:
|
| 32 |
|
| 33 |
The sequence
|
| 34 |
|
|
|
|
| 69 |
#include "vers2.h" (after macro replacement, before file access)
|
| 70 |
"hello";
|
| 71 |
"hello, world"
|
| 72 |
```
|
| 73 |
|
| 74 |
+
Space around the `#` and `##` preprocessing tokens in the macro
|
| 75 |
+
definition is optional.
|
| 76 |
|
| 77 |
— *end example*]
|
| 78 |
|
| 79 |
[*Example 2*:
|
| 80 |
|
|
|
|
| 96 |
in_between(x ## y)
|
| 97 |
mkstr(x ## y)
|
| 98 |
"x ## y"
|
| 99 |
```
|
| 100 |
|
| 101 |
+
In other words, expanding `hash_hash` produces a new preprocessing
|
| 102 |
+
token, consisting of two adjacent sharp signs, but this new
|
| 103 |
+
preprocessing token is not the `##` operator.
|
| 104 |
|
| 105 |
— *end example*]
|
| 106 |
|
| 107 |
[*Example 3*:
|
| 108 |
|