From Jason Turner

[clocale.syn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpcl2irmst/{from.md → to.md} +237 -0
tmp/tmpcl2irmst/{from.md → to.md} RENAMED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Header `<clocale>` synopsis <a id="clocale.syn">[[clocale.syn]]</a>
2
+
3
+ ``` cpp
4
+ namespace std {
5
+ struct lconv;
6
+
7
+ char* setlocale(int category, const char* locale);
8
+ lconv* localeconv();
9
+ }
10
+
11
+ #define NULL see [support.types.nullptr]
12
+ #define LC_ALL see below
13
+ #define LC_COLLATE see below
14
+ #define LC_CTYPE see below
15
+ #define LC_MONETARY see below
16
+ #define LC_NUMERIC see below
17
+ #define LC_TIME see below
18
+ ```
19
+
20
+ The contents and meaning of the header `<clocale>` are the same as the C
21
+ standard library header `<locale.h>`.
22
+
23
+ Calls to the function `setlocale` may introduce a data race (
24
+ [[res.on.data.races]]) with other calls to `setlocale` or with calls to
25
+ the functions listed in Table  [[tab:setlocale.data.races]].
26
+
27
+ ISO C 7.11.
28
+
29
+ **Table: Potential `setlocale` data races** <a id="tab:setlocale.data.races">[tab:setlocale.data.races]</a>
30
+
31
+ | | | | | |
32
+ | --------- | ---------- | ----------- | ------------ | ---------- |
33
+ | `fprintf` | `isprint` | `iswdigit` | `localeconv` | `tolower` |
34
+ | `fscanf` | `ispunct` | `iswgraph` | `mblen` | `toupper` |
35
+ | `isalnum` | `isspace` | `iswlower` | `mbstowcs` | `towlower` |
36
+ | `isalpha` | `isupper` | `iswprint` | `mbtowc` | `towupper` |
37
+ | `isblank` | `iswalnum` | `iswpunct` | `setlocale` | `wcscoll` |
38
+ | `iscntrl` | `iswalpha` | `iswspace` | `strcoll` | `wcstod` |
39
+ | `isdigit` | `iswblank` | `iswupper` | `strerror` | `wcstombs` |
40
+ | `isgraph` | `iswcntrl` | `iswxdigit` | `strtod` | `wcsxfrm` |
41
+ | `islower` | `iswctype` | `isxdigit` | `strxfrm` | `wctomb` |
42
+
43
+
44
+
45
+ <!-- Link reference definitions -->
46
+ [alg.lex.comparison]: algorithms.md#alg.lex.comparison
47
+ [alg.sort]: algorithms.md#alg.sort
48
+ [algorithms]: algorithms.md#algorithms
49
+ [basic.start.static]: basic.md#basic.start.static
50
+ [bitmask.types]: library.md#bitmask.types
51
+ [c.files]: input.md#c.files
52
+ [c.locales]: #c.locales
53
+ [category.collate]: #category.collate
54
+ [category.ctype]: #category.ctype
55
+ [category.messages]: #category.messages
56
+ [category.monetary]: #category.monetary
57
+ [category.numeric]: #category.numeric
58
+ [category.time]: #category.time
59
+ [classification]: #classification
60
+ [clocale.syn]: #clocale.syn
61
+ [conversions]: #conversions
62
+ [conversions.character]: #conversions.character
63
+ [facet.ctype.char.dtor]: #facet.ctype.char.dtor
64
+ [facet.ctype.char.members]: #facet.ctype.char.members
65
+ [facet.ctype.char.statics]: #facet.ctype.char.statics
66
+ [facet.ctype.char.virtuals]: #facet.ctype.char.virtuals
67
+ [facet.ctype.special]: #facet.ctype.special
68
+ [facet.num.get.members]: #facet.num.get.members
69
+ [facet.num.get.virtuals]: #facet.num.get.virtuals
70
+ [facet.num.put.members]: #facet.num.put.members
71
+ [facet.num.put.virtuals]: #facet.num.put.virtuals
72
+ [facet.numpunct]: #facet.numpunct
73
+ [facet.numpunct.members]: #facet.numpunct.members
74
+ [facet.numpunct.virtuals]: #facet.numpunct.virtuals
75
+ [facets.examples]: #facets.examples
76
+ [file.streams]: input.md#file.streams
77
+ [ios.base]: input.md#ios.base
78
+ [istream.formatted]: input.md#istream.formatted
79
+ [istream.formatted.reqmts]: input.md#istream.formatted.reqmts
80
+ [iterator.requirements]: iterators.md#iterator.requirements
81
+ [lex.charset]: lex.md#lex.charset
82
+ [locale]: #locale
83
+ [locale.categories]: #locale.categories
84
+ [locale.category]: #locale.category
85
+ [locale.codecvt]: #locale.codecvt
86
+ [locale.codecvt.byname]: #locale.codecvt.byname
87
+ [locale.codecvt.members]: #locale.codecvt.members
88
+ [locale.codecvt.virtuals]: #locale.codecvt.virtuals
89
+ [locale.collate]: #locale.collate
90
+ [locale.collate.byname]: #locale.collate.byname
91
+ [locale.collate.members]: #locale.collate.members
92
+ [locale.collate.virtuals]: #locale.collate.virtuals
93
+ [locale.cons]: #locale.cons
94
+ [locale.convenience]: #locale.convenience
95
+ [locale.ctype]: #locale.ctype
96
+ [locale.ctype.byname]: #locale.ctype.byname
97
+ [locale.ctype.members]: #locale.ctype.members
98
+ [locale.ctype.virtuals]: #locale.ctype.virtuals
99
+ [locale.facet]: #locale.facet
100
+ [locale.global.templates]: #locale.global.templates
101
+ [locale.id]: #locale.id
102
+ [locale.members]: #locale.members
103
+ [locale.messages]: #locale.messages
104
+ [locale.messages.byname]: #locale.messages.byname
105
+ [locale.messages.members]: #locale.messages.members
106
+ [locale.messages.virtuals]: #locale.messages.virtuals
107
+ [locale.money.get]: #locale.money.get
108
+ [locale.money.get.members]: #locale.money.get.members
109
+ [locale.money.get.virtuals]: #locale.money.get.virtuals
110
+ [locale.money.put]: #locale.money.put
111
+ [locale.money.put.members]: #locale.money.put.members
112
+ [locale.money.put.virtuals]: #locale.money.put.virtuals
113
+ [locale.moneypunct]: #locale.moneypunct
114
+ [locale.moneypunct.byname]: #locale.moneypunct.byname
115
+ [locale.moneypunct.members]: #locale.moneypunct.members
116
+ [locale.moneypunct.virtuals]: #locale.moneypunct.virtuals
117
+ [locale.nm.put]: #locale.nm.put
118
+ [locale.num.get]: #locale.num.get
119
+ [locale.numpunct]: #locale.numpunct
120
+ [locale.numpunct.byname]: #locale.numpunct.byname
121
+ [locale.operators]: #locale.operators
122
+ [locale.statics]: #locale.statics
123
+ [locale.syn]: #locale.syn
124
+ [locale.time.get]: #locale.time.get
125
+ [locale.time.get.byname]: #locale.time.get.byname
126
+ [locale.time.get.members]: #locale.time.get.members
127
+ [locale.time.get.virtuals]: #locale.time.get.virtuals
128
+ [locale.time.put]: #locale.time.put
129
+ [locale.time.put.byname]: #locale.time.put.byname
130
+ [locale.time.put.members]: #locale.time.put.members
131
+ [locale.time.put.virtuals]: #locale.time.put.virtuals
132
+ [locale.types]: #locale.types
133
+ [locales]: #locales
134
+ [localization]: #localization
135
+ [localization.general]: #localization.general
136
+ [ostream.formatted.reqmts]: input.md#ostream.formatted.reqmts
137
+ [res.on.data.races]: library.md#res.on.data.races
138
+ [sequence.reqmts]: containers.md#sequence.reqmts
139
+ [tab:lib.locale.time.get.virtuals.dogetdate]: #tab:lib.locale.time.get.virtuals.dogetdate
140
+ [tab:localization.category.facets]: #tab:localization.category.facets
141
+ [tab:localization.convert.result.values.out.in]: #tab:localization.convert.result.values.out.in
142
+ [tab:localization.convert.result.values.unshift]: #tab:localization.convert.result.values.unshift
143
+ [tab:localization.lib.summary]: #tab:localization.lib.summary
144
+ [tab:localization.required.specializations]: #tab:localization.required.specializations
145
+ [tab:setlocale.data.races]: #tab:setlocale.data.races
146
+ [vector]: containers.md#vector
147
+
148
+ [^1]: In this subclause, the type name `struct tm` is an incomplete type
149
+ that is defined in `<ctime>`.
150
+
151
+ [^2]: Note that in the call to `put` the stream is implicitly converted
152
+ to an `ostreambuf_iterator<charT, traits>`.
153
+
154
+ [^3]: This is a complete list of requirements; there are no other
155
+ requirements. Thus, a facet class need not have a public copy
156
+ constructor, assignment, default constructor, destructor, etc.
157
+
158
+ [^4]: When used in a loop, it is faster to cache the `ctype<>` facet and
159
+ use it directly, or use the vector form of `ctype<>::is`.
160
+
161
+ [^5]: The char argument of `do_widen` is intended to accept values
162
+ derived from character literals for conversion to the locale’s
163
+ encoding.
164
+
165
+ [^6]: In other words, the transformed character is not a member of any
166
+ character classification that `c` is not also a member of.
167
+
168
+ [^7]: Only the `char` (not `unsigned char` and `signed char`) form is
169
+ provided. The specialization is specified in the standard, and not
170
+ left as an implementation detail, because it affects the derivation
171
+ interface for `ctype<char>`.
172
+
173
+ [^8]: Informally, this means that `basic_filebuf` assumes that the
174
+ mappings from internal to external characters is 1 to N: a `codecvt`
175
+ facet that is used by `basic_filebuf` must be able to translate
176
+ characters one internal character at a time.
177
+
178
+ [^9]: Typically these will be characters to return the state to
179
+ `stateT()`.
180
+
181
+ [^10]: If `encoding()` yields `-1`, then more than `max_length()`
182
+ `externT` elements may be consumed when producing a single `internT`
183
+ character, and additional `externT` elements may appear at the end
184
+ of a sequence after those that yield the final `internT` character.
185
+
186
+ [^11]: Parsing `"-1"` correctly into, e.g., an `unsigned short` requires
187
+ that the corresponding member `get()` at least extract the sign
188
+ before delegating.
189
+
190
+ [^12]: The conversion specification `#o` generates a leading `0` which
191
+ is *not* a padding character.
192
+
193
+ [^13]: Thus, the string `"\003"` specifies groups of 3 digits each, and
194
+ `"3"` probably indicates groups of 51 (!) digits each, because 51 is
195
+ the ASCII value of `"3"`.
196
+
197
+ [^14]: This function is useful when one string is being compared to many
198
+ other strings.
199
+
200
+ [^15]: In other words, user confirmation is required for reliable
201
+ parsing of user-entered dates and times, but machine-generated
202
+ formats can be parsed reliably. This allows parsers to be aggressive
203
+ about interpreting user variations on standard formats.
204
+
205
+ [^16]: This function is intended as a convenience only, for common
206
+ formats, and may return `no_order` in valid locales.
207
+
208
+ [^17]: Although the C programming language defines no modifiers, most
209
+ vendors do.
210
+
211
+ [^18]: Interpretation of the `modifier` argument is
212
+ implementation-defined, but should follow POSIX conventions.
213
+
214
+ [^19]: Implementations are encouraged to refer to other standards such
215
+ as POSIX for these definitions.
216
+
217
+ [^20]: The semantics here are different from `ct.narrow`.
218
+
219
+ [^21]: An array of `char`, rather than an array of `part`, is specified
220
+ for `pattern::field` purely for efficiency.
221
+
222
+ [^22]: In common U.S. locales this is `’.’`.
223
+
224
+ [^23]: In common U.S. locales this is `’,’`.
225
+
226
+ [^24]: To specify grouping by 3s, the value is `"\003"` *not* `"3"`.
227
+
228
+ [^25]: For international specializations (second template parameter
229
+ `true`) this is typically four characters long, usually three
230
+ letters and a space.
231
+
232
+ [^26]: This is usually the empty string.
233
+
234
+ [^27]: In common U.S. locales, this is 2.
235
+
236
+ [^28]: Note that the international symbol returned by `do_curr_sym()`
237
+ usually contains a space, itself; for example, `"USD "`.