From Jason Turner

[cpp]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp7voerwuu/{from.md → to.md} +20 -20
tmp/tmp7voerwuu/{from.md → to.md} RENAMED
@@ -25,11 +25,11 @@ group:
25
  ``` bnf
26
  group-part:
27
  if-section
28
  control-line
29
  text-line
30
- \# non-directive
31
  ```
32
 
33
  ``` bnf
34
  if-section:
35
  if-group elif-groupsₒₚₜ else-groupₒₚₜ endif-line
@@ -229,14 +229,14 @@ A preprocessing directive of the form
229
  '# include' pp-tokens new-line
230
  ```
231
 
232
  (that does not match one of the two previous forms) is permitted. The
233
  preprocessing tokens after `include` in the directive are processed just
234
- as in normal text (Each identifier currently defined as a macro name is
235
- replaced by its replacement list of preprocessing tokens.). If the
236
- directive resulting after all replacements does not match one of the two
237
- previous forms, the behavior is undefined.[^7] The method by which a
238
  sequence of preprocessing tokens between a `<` and a `>` preprocessing
239
  token pair or a pair of `"` characters is combined into a single header
240
  name preprocessing token is *implementation-defined*.
241
 
242
  The implementation shall provide unique mappings for sequences
@@ -358,16 +358,16 @@ macro. The individual arguments within the list are separated by comma
358
  preprocessing tokens, but comma preprocessing tokens between matching
359
  inner parentheses do not separate arguments. If there are sequences of
360
  preprocessing tokens within the list of arguments that would otherwise
361
  act as preprocessing directives,[^10] the behavior is undefined.
362
 
363
- If there is a `...` in the identifier-list in the macro definition, then
364
- the trailing arguments, including any separating comma preprocessing
365
- tokens, are merged to form a single item: the variable arguments. The
366
- number of arguments so combined is such that, following merger, the
367
- number of arguments is one more than the number of parameters in the
368
- macro definition (excluding the `...`).
369
 
370
  ### Argument substitution <a id="cpp.subst">[[cpp.subst]]</a>
371
 
372
  After the arguments for the invocation of a function-like macro have
373
  been identified, argument substitution takes place. A parameter in the
@@ -526,11 +526,11 @@ To illustrate the rules for redefinition and reexamination, the sequence
526
  #define f(a) f(x * (a))
527
  #undef x
528
  #define x 2
529
  #define g f
530
  #define z z[0]
531
- #define h g(\sim
532
  #define m(a) a(w)
533
  #define w 0,1
534
  #define t(a) a
535
  #define p() int
536
  #define q(x) x
@@ -546,11 +546,11 @@ char c[2][6] = { str(hello), str() };
546
 
547
  results in
548
 
549
  ``` cpp
550
  f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
551
- f(2 * (2+(3,4)-0,1)) | f(2 * (\sim 5)) & f(2 * (0,1))^m(0,1);
552
  int i[] = { 1, 23, 4, 5, };
553
  char c[2][6] = { "hello", "" };
554
  ```
555
 
556
  To illustrate the rules for creating character string literals and
@@ -758,18 +758,18 @@ The presumed name of the current source file (a character string
758
  literal).[^13]
759
 
760
  - **`__LINE__`**
761
 
762
  The presumed line number (within the current source file) of the current
763
- source line (an integer constant).
764
 
765
   
766
 
767
  - **`__STDC_HOSTED__`**
768
 
769
- The integer constant `1` if the implementation is a hosted
770
- implementation or the integer constant `0` if it is not.
771
 
772
  - **`__TIME__`**
773
 
774
  The time of translation of the source file: a character string literal
775
  of the form `"hh:mm:ss"` as in the time generated by the `asctime`
@@ -784,11 +784,11 @@ implementation:
784
  Whether \_\_STDC\_\_ is predefined and if so, what its value is, are
785
  *implementation-defined*.
786
 
787
  - **`__STDC_MB_MIGHT_NEQ_WC__`**
788
 
789
- The integer constant `1`, intended to indicate that, in the encoding for
790
  `wchar_t`, a member of the basic character set need not have a code
791
  value equal to its value when used as the lone character in an ordinary
792
  character literal.
793
 
794
  - **`__STDC_VERSION__`**
@@ -796,27 +796,27 @@ character literal.
796
  Whether \_\_STDC_VERSION\_\_ is predefined and if so, what its value is,
797
  are *implementation-defined*.
798
 
799
  - **`__STDC_ISO_10646__`**
800
 
801
- An integer constant of the form `yyyymmL` (for example, `199712L`). If
802
  this symbol is defined, then every character in the Unicode required
803
  set, when stored in an object of type `wchar_t`, has the same value as
804
  the short identifier of that character. The *Unicode required set*
805
  consists of all the characters that are defined by ISO/IEC 10646, along
806
  with all amendments and technical corrigenda as of the specified year
807
  and month.
808
 
809
  - **`__STDCPP_STRICT_POINTER_SAFETY__`**
810
 
811
- Defined, and has the value integer constant 1, if and only if the
812
  implementation has strict pointer safety (
813
  [[basic.stc.dynamic.safety]]).
814
 
815
  - **`__STDCPP_THREADS__`**
816
 
817
- Defined, and has the value integer constant 1, if and only if a program
818
  can have more than one thread of execution ([[intro.multithread]]).
819
 
820
  The values of the predefined macros (except for `__FILE__` and
821
  `__LINE__`) remain constant throughout the translation unit.
822
 
 
25
  ``` bnf
26
  group-part:
27
  if-section
28
  control-line
29
  text-line
30
+ '#' non-directive
31
  ```
32
 
33
  ``` bnf
34
  if-section:
35
  if-group elif-groupsₒₚₜ else-groupₒₚₜ endif-line
 
229
  '# include' pp-tokens new-line
230
  ```
231
 
232
  (that does not match one of the two previous forms) is permitted. The
233
  preprocessing tokens after `include` in the directive are processed just
234
+ as in normal text (i.e., each identifier currently defined as a macro
235
+ name is replaced by its replacement list of preprocessing tokens). If
236
+ the directive resulting after all replacements does not match one of the
237
+ two previous forms, the behavior is undefined.[^7] The method by which a
238
  sequence of preprocessing tokens between a `<` and a `>` preprocessing
239
  token pair or a pair of `"` characters is combined into a single header
240
  name preprocessing token is *implementation-defined*.
241
 
242
  The implementation shall provide unique mappings for sequences
 
358
  preprocessing tokens, but comma preprocessing tokens between matching
359
  inner parentheses do not separate arguments. If there are sequences of
360
  preprocessing tokens within the list of arguments that would otherwise
361
  act as preprocessing directives,[^10] the behavior is undefined.
362
 
363
+ If there is a `...` immediately preceding the `)` in the function-like
364
+ macro definition, then the trailing arguments, including any separating
365
+ comma preprocessing tokens, are merged to form a single item: the
366
+ *variable arguments*. The number of arguments so combined is such that,
367
+ following merger, the number of arguments is one more than the number of
368
+ parameters in the macro definition (excluding the `...`).
369
 
370
  ### Argument substitution <a id="cpp.subst">[[cpp.subst]]</a>
371
 
372
  After the arguments for the invocation of a function-like macro have
373
  been identified, argument substitution takes place. A parameter in the
 
526
  #define f(a) f(x * (a))
527
  #undef x
528
  #define x 2
529
  #define g f
530
  #define z z[0]
531
+ #define h g(~
532
  #define m(a) a(w)
533
  #define w 0,1
534
  #define t(a) a
535
  #define p() int
536
  #define q(x) x
 
546
 
547
  results in
548
 
549
  ``` cpp
550
  f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
551
+ f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
552
  int i[] = { 1, 23, 4, 5, };
553
  char c[2][6] = { "hello", "" };
554
  ```
555
 
556
  To illustrate the rules for creating character string literals and
 
758
  literal).[^13]
759
 
760
  - **`__LINE__`**
761
 
762
  The presumed line number (within the current source file) of the current
763
+ source line (an integer literal).
764
 
765
   
766
 
767
  - **`__STDC_HOSTED__`**
768
 
769
+ The integer literal `1` if the implementation is a hosted implementation
770
+ or the integer literal `0` if it is not.
771
 
772
  - **`__TIME__`**
773
 
774
  The time of translation of the source file: a character string literal
775
  of the form `"hh:mm:ss"` as in the time generated by the `asctime`
 
784
  Whether \_\_STDC\_\_ is predefined and if so, what its value is, are
785
  *implementation-defined*.
786
 
787
  - **`__STDC_MB_MIGHT_NEQ_WC__`**
788
 
789
+ The integer literal `1`, intended to indicate that, in the encoding for
790
  `wchar_t`, a member of the basic character set need not have a code
791
  value equal to its value when used as the lone character in an ordinary
792
  character literal.
793
 
794
  - **`__STDC_VERSION__`**
 
796
  Whether \_\_STDC_VERSION\_\_ is predefined and if so, what its value is,
797
  are *implementation-defined*.
798
 
799
  - **`__STDC_ISO_10646__`**
800
 
801
+ An integer literal of the form `yyyymmL` (for example, `199712L`). If
802
  this symbol is defined, then every character in the Unicode required
803
  set, when stored in an object of type `wchar_t`, has the same value as
804
  the short identifier of that character. The *Unicode required set*
805
  consists of all the characters that are defined by ISO/IEC 10646, along
806
  with all amendments and technical corrigenda as of the specified year
807
  and month.
808
 
809
  - **`__STDCPP_STRICT_POINTER_SAFETY__`**
810
 
811
+ Defined, and has the value integer literal 1, if and only if the
812
  implementation has strict pointer safety (
813
  [[basic.stc.dynamic.safety]]).
814
 
815
  - **`__STDCPP_THREADS__`**
816
 
817
+ Defined, and has the value integer literal 1, if and only if a program
818
  can have more than one thread of execution ([[intro.multithread]]).
819
 
820
  The values of the predefined macros (except for `__FILE__` and
821
  `__LINE__`) remain constant throughout the translation unit.
822