From Jason Turner

[locale.numpunct]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmprxqd7558/{from.md → to.md} +58 -28
tmp/tmprxqd7558/{from.md → to.md} RENAMED
@@ -29,43 +29,73 @@ namespace std {
29
  }
30
  ```
31
 
32
  `numpunct<>`
33
 
34
- specifies numeric punctuation. The specializations required in Table 
35
- [[tab:localization.category.facets]] ([[locale.category]]), namely
36
  `numpunct<{}wchar_t>` and `numpunct<char>`, provide classic `"C"`
37
  numeric formats, i.e., they contain information equivalent to that
38
  contained in the `"C"` locale or their wide character counterparts as if
39
  obtained by a call to `widen`.
40
 
41
- The syntax for number formats is as follows, where `digit` represents
42
- the radix set specified by the `fmtflags` argument value, and
43
- `thousands-sep` and `decimal-point` are the results of corresponding
44
- `numpunct<charT>` members. Integer values have the format:
45
-
46
- ``` cpp
47
- integer ::= [sign] units
48
- sign ::= plusminus
49
- plusminus ::= '+' | '-'
50
- units ::= digits [thousands-sep units]
51
- digits ::= digit [digits]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  ```
53
 
54
  and floating-point values have:
55
 
56
- ``` cpp
57
- floatval ::= [sign] units [decimal-point [digits]] [e [sign] digits] |
58
- [sign] decimal-point digits [e [sign] digits]
59
- e ::= 'e' | 'E'
60
  ```
61
 
62
- where the number of digits between `thousands-sep`s is as specified by
63
- `do_grouping()`. For parsing, if the `digits` portion contains no
64
- thousands-separators, no grouping constraint is applied.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
- ##### `numpunct` members <a id="facet.numpunct.members">[[facet.numpunct.members]]</a>
67
 
68
  ``` cpp
69
  char_type decimal_point() const;
70
  ```
71
 
@@ -88,11 +118,11 @@ string_type truename() const;
88
  string_type falsename() const;
89
  ```
90
 
91
  *Returns:* `do_truename()` or `do_falsename()`, respectively.
92
 
93
- ##### `numpunct` virtual functions <a id="facet.numpunct.virtuals">[[facet.numpunct.virtuals]]</a>
94
 
95
  ``` cpp
96
  char_type do_decimal_point() const;
97
  ```
98
 
@@ -108,16 +138,16 @@ required specializations return `’,’` or `L’,’`.
108
 
109
  ``` cpp
110
  string do_grouping() const;
111
  ```
112
 
113
- *Returns:* A basic_string\<char\> `vec` used as a vector of integer
114
- values, in which each element `vec[i]` represents the number of
115
- digits[^13] in the group at position `i`, starting with position 0 as
116
- the rightmost group. If `vec.size() <= i`, the number is the same as
117
- group `(i - 1)`; if `(i < 0 || vec[i] <= 0 || vec[i] == CHAR_MAX)`, the
118
- size of the digit group is unlimited.
119
 
120
  The required specializations return the empty string, indicating no
121
  grouping.
122
 
123
  ``` cpp
 
29
  }
30
  ```
31
 
32
  `numpunct<>`
33
 
34
+ specifies numeric punctuation. The specializations required in
35
+ [[locale.category.facets]] [[locale.category]], namely
36
  `numpunct<{}wchar_t>` and `numpunct<char>`, provide classic `"C"`
37
  numeric formats, i.e., they contain information equivalent to that
38
  contained in the `"C"` locale or their wide character counterparts as if
39
  obtained by a call to `widen`.
40
 
41
+ The syntax for number formats is as follows, where represents the radix
42
+ set specified by the `fmtflags` argument value, and and are the results
43
+ of corresponding `numpunct<charT>` members. Integer values have the
44
+ format:
45
+
46
+ ``` bnf
47
+ intval:
48
+ signₒₚₜ units
49
+ ```
50
+
51
+ ``` bnf
52
+ sign:
53
+ '+'
54
+ '-'
55
+ ```
56
+
57
+ ``` bnf
58
+ units:
59
+ digits
60
+ digits thousands-sep units
61
+ ```
62
+
63
+ ``` bnf
64
+ digits:
65
+ digit digitsₒₚₜ
66
  ```
67
 
68
  and floating-point values have:
69
 
70
+ ``` bnf
71
+ floatval:
72
+ signₒₚₜ units fractionalₒₚₜ exponentₒₚₜ
73
+ signₒₚₜ decimal-point digits exponentₒₚₜ
74
  ```
75
 
76
+ ``` bnf
77
+ fractional:
78
+ decimal-point digitsₒₚₜ
79
+ ```
80
+
81
+ ``` bnf
82
+ exponent:
83
+ e signₒₚₜ digits
84
+ ```
85
+
86
+ ``` bnf
87
+ e:
88
+ 'e'
89
+ 'E'
90
+ ```
91
+
92
+ where the number of digits between is as specified by `do_grouping()`.
93
+ For parsing, if the portion contains no thousands-separators, no
94
+ grouping constraint is applied.
95
 
96
+ ##### Members <a id="facet.numpunct.members">[[facet.numpunct.members]]</a>
97
 
98
  ``` cpp
99
  char_type decimal_point() const;
100
  ```
101
 
 
118
  string_type falsename() const;
119
  ```
120
 
121
  *Returns:* `do_truename()` or `do_falsename()`, respectively.
122
 
123
+ ##### Virtual functions <a id="facet.numpunct.virtuals">[[facet.numpunct.virtuals]]</a>
124
 
125
  ``` cpp
126
  char_type do_decimal_point() const;
127
  ```
128
 
 
138
 
139
  ``` cpp
140
  string do_grouping() const;
141
  ```
142
 
143
+ *Returns:* A `string` `vec` used as a vector of integer values, in which
144
+ each element `vec[i]` represents the number of digits[^13] in the group
145
+ at position `i`, starting with position 0 as the rightmost group. If
146
+ `vec.size() <= i`, the number is the same as group `(i - 1)`; if
147
+ `(i < 0 || vec[i] <= 0 || vec[i] == CHAR_MAX)`, the size of the digit
148
+ group is unlimited.
149
 
150
  The required specializations return the empty string, indicating no
151
  grouping.
152
 
153
  ``` cpp