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