From Jason Turner

[c.strings]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp4na2yguj/{from.md → to.md} +40 -327
tmp/tmp4na2yguj/{from.md → to.md} RENAMED
@@ -1,362 +1,77 @@
1
  ## Null-terminated sequence utilities <a id="c.strings">[[c.strings]]</a>
2
 
3
- ### Header `<cctype>` synopsis <a id="cctype.syn">[[cctype.syn]]</a>
4
-
5
- ``` cpp
6
- namespace std {
7
- int isalnum(int c);
8
- int isalpha(int c);
9
- int isblank(int c);
10
- int iscntrl(int c);
11
- int isdigit(int c);
12
- int isgraph(int c);
13
- int islower(int c);
14
- int isprint(int c);
15
- int ispunct(int c);
16
- int isspace(int c);
17
- int isupper(int c);
18
- int isxdigit(int c);
19
- int tolower(int c);
20
- int toupper(int c);
21
- }
22
- ```
23
-
24
- The contents and meaning of the header `<cctype>` are the same as the C
25
- standard library header `<ctype.h>`.
26
-
27
- See also: ISO C 7.4
28
-
29
- ### Header `<cwctype>` synopsis <a id="cwctype.syn">[[cwctype.syn]]</a>
30
-
31
- ``` cpp
32
- namespace std {
33
- using wint_t = see below;
34
- using wctrans_t = see below;
35
- using wctype_t = see below;
36
-
37
- int iswalnum(wint_t wc);
38
- int iswalpha(wint_t wc);
39
- int iswblank(wint_t wc);
40
- int iswcntrl(wint_t wc);
41
- int iswdigit(wint_t wc);
42
- int iswgraph(wint_t wc);
43
- int iswlower(wint_t wc);
44
- int iswprint(wint_t wc);
45
- int iswpunct(wint_t wc);
46
- int iswspace(wint_t wc);
47
- int iswupper(wint_t wc);
48
- int iswxdigit(wint_t wc);
49
- int iswctype(wint_t wc, wctype_t desc);
50
- wctype_t wctype(const char* property);
51
- wint_t towlower(wint_t wc);
52
- wint_t towupper(wint_t wc);
53
- wint_t towctrans(wint_t wc, wctrans_t desc);
54
- wctrans_t wctrans(const char* property);
55
- }
56
-
57
- #define WEOF see below
58
- ```
59
-
60
- The contents and meaning of the header `<cwctype>` are the same as the C
61
- standard library header `<wctype.h>`.
62
-
63
- See also: ISO C 7.30
64
-
65
  ### Header `<cstring>` synopsis <a id="cstring.syn">[[cstring.syn]]</a>
66
 
67
  ``` cpp
 
 
68
  namespace std {
69
- using size_t = see [support.types.layout];
70
 
71
- void* memcpy(void* s1, const void* s2, size_t n);
72
- void* memmove(void* s1, const void* s2, size_t n);
73
- char* strcpy(char* s1, const char* s2);
74
- char* strncpy(char* s1, const char* s2, size_t n);
75
- char* strcat(char* s1, const char* s2);
76
- char* strncat(char* s1, const char* s2, size_t n);
77
- int memcmp(const void* s1, const void* s2, size_t n);
78
- int strcmp(const char* s1, const char* s2);
 
 
 
79
  int strcoll(const char* s1, const char* s2);
80
- int strncmp(const char* s1, const char* s2, size_t n);
81
  size_t strxfrm(char* s1, const char* s2, size_t n);
82
- const void* memchr(const void* s, int c, size_t n); // see [library.c]
83
- void* memchr(void* s, int c, size_t n); // see [library.c]
84
- const char* strchr(const char* s, int c); // see [library.c]
85
- char* strchr(char* s, int c); // see [library.c]
86
- size_t strcspn(const char* s1, const char* s2);
87
- const char* strpbrk(const char* s1, const char* s2); // see [library.c]
88
- char* strpbrk(char* s1, const char* s2); // see [library.c]
89
- const char* strrchr(const char* s, int c); // see [library.c]
90
- char* strrchr(char* s, int c); // see [library.c]
91
- size_t strspn(const char* s1, const char* s2);
92
- const char* strstr(const char* s1, const char* s2); // see [library.c]
93
- char* strstr(char* s1, const char* s2); // see [library.c]
94
  char* strtok(char* s1, const char* s2);
95
- void* memset(void* s, int c, size_t n);
 
96
  char* strerror(int errnum);
97
- size_t strlen(const char* s);
98
  }
99
 
100
- #define NULL see [support.types.nullptr]
101
  ```
102
 
103
  The contents and meaning of the header `<cstring>` are the same as the C
104
  standard library header `<string.h>`.
105
 
106
  The functions `strerror` and `strtok` are not required to avoid data
107
  races [[res.on.data.races]].
108
 
109
  The functions `memcpy` and `memmove` are signal-safe [[support.signal]].
110
- Both functions implicitly create objects [[intro.object]] in the
111
- destination region of storage immediately prior to copying the sequence
112
- of characters to the destination.
 
 
113
 
114
  [*Note 1*: The functions `strchr`, `strpbrk`, `strrchr`, `strstr`, and
115
  `memchr`, have different signatures in this document, but they have the
116
  same behavior as in the C standard library [[library.c]]. — *end note*]
117
 
118
- See also: ISO C 7.24
119
-
120
- ### Header `<cwchar>` synopsis <a id="cwchar.syn">[[cwchar.syn]]</a>
121
-
122
- ``` cpp
123
- namespace std {
124
- using size_t = see [support.types.layout];
125
- using mbstate_t = see below;
126
- using wint_t = see below;
127
-
128
- struct tm;
129
-
130
- int fwprintf(FILE* stream, const wchar_t* format, ...);
131
- int fwscanf(FILE* stream, const wchar_t* format, ...);
132
- int swprintf(wchar_t* s, size_t n, const wchar_t* format, ...);
133
- int swscanf(const wchar_t* s, const wchar_t* format, ...);
134
- int vfwprintf(FILE* stream, const wchar_t* format, va_list arg);
135
- int vfwscanf(FILE* stream, const wchar_t* format, va_list arg);
136
- int vswprintf(wchar_t* s, size_t n, const wchar_t* format, va_list arg);
137
- int vswscanf(const wchar_t* s, const wchar_t* format, va_list arg);
138
- int vwprintf(const wchar_t* format, va_list arg);
139
- int vwscanf(const wchar_t* format, va_list arg);
140
- int wprintf(const wchar_t* format, ...);
141
- int wscanf(const wchar_t* format, ...);
142
- wint_t fgetwc(FILE* stream);
143
- wchar_t* fgetws(wchar_t* s, int n, FILE* stream);
144
- wint_t fputwc(wchar_t c, FILE* stream);
145
- int fputws(const wchar_t* s, FILE* stream);
146
- int fwide(FILE* stream, int mode);
147
- wint_t getwc(FILE* stream);
148
- wint_t getwchar();
149
- wint_t putwc(wchar_t c, FILE* stream);
150
- wint_t putwchar(wchar_t c);
151
- wint_t ungetwc(wint_t c, FILE* stream);
152
- double wcstod(const wchar_t* nptr, wchar_t** endptr);
153
- float wcstof(const wchar_t* nptr, wchar_t** endptr);
154
- long double wcstold(const wchar_t* nptr, wchar_t** endptr);
155
- long int wcstol(const wchar_t* nptr, wchar_t** endptr, int base);
156
- long long int wcstoll(const wchar_t* nptr, wchar_t** endptr, int base);
157
- unsigned long int wcstoul(const wchar_t* nptr, wchar_t** endptr, int base);
158
- unsigned long long int wcstoull(const wchar_t* nptr, wchar_t** endptr, int base);
159
- wchar_t* wcscpy(wchar_t* s1, const wchar_t* s2);
160
- wchar_t* wcsncpy(wchar_t* s1, const wchar_t* s2, size_t n);
161
- wchar_t* wmemcpy(wchar_t* s1, const wchar_t* s2, size_t n);
162
- wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n);
163
- wchar_t* wcscat(wchar_t* s1, const wchar_t* s2);
164
- wchar_t* wcsncat(wchar_t* s1, const wchar_t* s2, size_t n);
165
- int wcscmp(const wchar_t* s1, const wchar_t* s2);
166
- int wcscoll(const wchar_t* s1, const wchar_t* s2);
167
- int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n);
168
- size_t wcsxfrm(wchar_t* s1, const wchar_t* s2, size_t n);
169
- int wmemcmp(const wchar_t* s1, const wchar_t* s2, size_t n);
170
- const wchar_t* wcschr(const wchar_t* s, wchar_t c); // see [library.c]
171
- wchar_t* wcschr(wchar_t* s, wchar_t c); // see [library.c]
172
- size_t wcscspn(const wchar_t* s1, const wchar_t* s2);
173
- const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2); // see [library.c]
174
- wchar_t* wcspbrk(wchar_t* s1, const wchar_t* s2); // see [library.c]
175
- const wchar_t* wcsrchr(const wchar_t* s, wchar_t c); // see [library.c]
176
- wchar_t* wcsrchr(wchar_t* s, wchar_t c); // see [library.c]
177
- size_t wcsspn(const wchar_t* s1, const wchar_t* s2);
178
- const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2); // see [library.c]
179
- wchar_t* wcsstr(wchar_t* s1, const wchar_t* s2); // see [library.c]
180
- wchar_t* wcstok(wchar_t* s1, const wchar_t* s2, wchar_t** ptr);
181
- const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n); // see [library.c]
182
- wchar_t* wmemchr(wchar_t* s, wchar_t c, size_t n); // see [library.c]
183
- size_t wcslen(const wchar_t* s);
184
- wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n);
185
- size_t wcsftime(wchar_t* s, size_t maxsize, const wchar_t* format, const tm* timeptr);
186
- wint_t btowc(int c);
187
- int wctob(wint_t c);
188
-
189
- // [c.mb.wcs], multibyte / wide string and character conversion functions
190
- int mbsinit(const mbstate_t* ps);
191
- size_t mbrlen(const char* s, size_t n, mbstate_t* ps);
192
- size_t mbrtowc(wchar_t* pwc, const char* s, size_t n, mbstate_t* ps);
193
- size_t wcrtomb(char* s, wchar_t wc, mbstate_t* ps);
194
- size_t mbsrtowcs(wchar_t* dst, const char** src, size_t len, mbstate_t* ps);
195
- size_t wcsrtombs(char* dst, const wchar_t** src, size_t len, mbstate_t* ps);
196
- }
197
-
198
- #define NULL see [support.types.nullptr]
199
- #define WCHAR_MAX see below
200
- #define WCHAR_MIN see below
201
- #define WEOF see below
202
- ```
203
-
204
- The contents and meaning of the header `<cwchar>` are the same as the C
205
- standard library header `<wchar.h>`, except that it does not declare a
206
- type `wchar_t`.
207
-
208
- [*Note 1*: The functions `wcschr`, `wcspbrk`, `wcsrchr`, `wcsstr`, and
209
- `wmemchr` have different signatures in this document, but they have the
210
- same behavior as in the C standard library [[library.c]]. — *end note*]
211
-
212
- See also: ISO C 7.29
213
-
214
- ### Header `<cuchar>` synopsis <a id="cuchar.syn">[[cuchar.syn]]</a>
215
-
216
- ``` cpp
217
- namespace std {
218
- using mbstate_t = see below;
219
- using size_t = see [support.types.layout];
220
-
221
- size_t mbrtoc8(char8_t* pc8, const char* s, size_t n, mbstate_t* ps);
222
- size_t c8rtomb(char* s, char8_t c8, mbstate_t* ps);
223
- size_t mbrtoc16(char16_t* pc16, const char* s, size_t n, mbstate_t* ps);
224
- size_t c16rtomb(char* s, char16_t c16, mbstate_t* ps);
225
- size_t mbrtoc32(char32_t* pc32, const char* s, size_t n, mbstate_t* ps);
226
- size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);
227
- }
228
- ```
229
-
230
- The contents and meaning of the header `<cuchar>` are the same as the C
231
- standard library header `<uchar.h>`, except that it declares the
232
- additional `mbrtoc8` and `c8rtomb` functions and does not declare types
233
- `char16_t` nor `char32_t`.
234
-
235
- See also: ISO C 7.28
236
-
237
- ### Multibyte / wide string and character conversion functions <a id="c.mb.wcs">[[c.mb.wcs]]</a>
238
-
239
- [*Note 1*: The headers `<cstdlib>`, `<cuchar>`, and `<cwchar>` declare
240
- the functions described in this subclause. — *end note*]
241
-
242
- ``` cpp
243
- int mbsinit(const mbstate_t* ps);
244
- int mblen(const char* s, size_t n);
245
- size_t mbstowcs(wchar_t* pwcs, const char* s, size_t n);
246
- size_t wcstombs(char* s, const wchar_t* pwcs, size_t n);
247
- ```
248
-
249
- *Effects:* These functions have the semantics specified in the C
250
- standard library.
251
-
252
- See also: ISO C 7.22.7.1, 7.22.8, 7.29.6.2.1
253
-
254
- ``` cpp
255
- int mbtowc(wchar_t* pwc, const char* s, size_t n);
256
- int wctomb(char* s, wchar_t wchar);
257
- ```
258
-
259
- *Effects:* These functions have the semantics specified in the C
260
- standard library.
261
-
262
- *Remarks:* Calls to these functions may introduce a data
263
- race [[res.on.data.races]] with other calls to the same function.
264
-
265
- See also: ISO C 7.22.7
266
-
267
- ``` cpp
268
- size_t mbrlen(const char* s, size_t n, mbstate_t* ps);
269
- size_t mbrtowc(wchar_t* pwc, const char* s, size_t n, mbstate_t* ps);
270
- size_t wcrtomb(char* s, wchar_t wc, mbstate_t* ps);
271
- size_t mbsrtowcs(wchar_t* dst, const char** src, size_t len, mbstate_t* ps);
272
- size_t wcsrtombs(char* dst, const wchar_t** src, size_t len, mbstate_t* ps);
273
- ```
274
-
275
- *Effects:* These functions have the semantics specified in the C
276
- standard library.
277
-
278
- *Remarks:* Calling these functions with an `mbstate_t*` argument that is
279
- a null pointer value may introduce a data race [[res.on.data.races]]
280
- with other calls to the same function with an `mbstate_t*` argument that
281
- is a null pointer value.
282
-
283
- See also: ISO C 7.29.6.3
284
-
285
- ``` cpp
286
- size_t mbrtoc8(char8_t* pc8, const char* s, size_t n, mbstate_t* ps);
287
- ```
288
-
289
- *Effects:* If `s` is a null pointer, equivalent to
290
- `mbrtoc8(nullptr, "", 1, ps)`. Otherwise, the function inspects at most
291
- `n` bytes beginning with the byte pointed to by `s` to determine the
292
- number of bytes needed to complete the next multibyte character
293
- (including any shift sequences). If the function determines that the
294
- next multibyte character is complete and valid, it determines the values
295
- of the corresponding UTF-8 code units and then, if `pc8` is not a null
296
- pointer, stores the value of the first (or only) such code unit in the
297
- object pointed to by `pc8`. Subsequent calls will store successive UTF-8
298
- code units without consuming any additional input until all the code
299
- units have been stored. If the corresponding Unicode character is
300
- U+0000 (null), the resulting state described is the initial conversion
301
- state.
302
-
303
- *Returns:* The first of the following that applies (given the current
304
- conversion state):
305
-
306
- - `0`, if the next `n` or fewer bytes complete the multibyte character
307
- that corresponds to the U+0000 (null) Unicode character (which is the
308
- value stored).
309
- - between `1` and `n` (inclusive), if the next n or fewer bytes complete
310
- a valid multibyte character (whose first (or only) code unit is
311
- stored); the value returned is the number of bytes that complete the
312
- multibyte character.
313
- - `(size_t)(-3)`, if the next code unit resulting from a previous call
314
- has been stored (no bytes from the input have been consumed by this
315
- call).
316
- - `(size_t)(-2)`, if the next `n` bytes contribute to an incomplete (but
317
- potentially valid) multibyte character, and all `n` bytes have been
318
- processed (no value is stored).
319
- - `(size_t)(-1)`, if an encoding error occurs, in which case the next
320
- `n` or fewer bytes do not contribute to a complete and valid multibyte
321
- character (no value is stored); the value of the macro `EILSEQ` is
322
- stored in `errno`, and the conversion state is unspecified.
323
-
324
- ``` cpp
325
- size_t c8rtomb(char* s, char8_t c8, mbstate_t* ps);
326
- ```
327
-
328
- *Effects:* If `s` is a null pointer, equivalent to
329
- `c8rtomb(buf, u8’`\`0’, ps)` where `buf` is an internal buffer.
330
- Otherwise, if `c8` completes a sequence of valid UTF-8 code units,
331
- determines the number of bytes needed to represent the multibyte
332
- character (including any shift sequences), and stores the multibyte
333
- character representation in the array whose first element is pointed to
334
- by `s`. At most `MB_CUR_MAX` bytes are stored. If the multibyte
335
- character is a null character, a null byte is stored, preceded by any
336
- shift sequence needed to restore the initial shift state; the resulting
337
- state described is the initial conversion state.
338
-
339
- *Returns:* The number of bytes stored in the array object (including any
340
- shift sequences). If `c8` does not contribute to a sequence of `char8_t`
341
- corresponding to a valid multibyte character, the value of the macro
342
- `EILSEQ` is stored in `errno`, `(size_t) (-1)` is returned, and the
343
- conversion state is unspecified.
344
-
345
- *Remarks:* Calls to `c8rtomb` with a null pointer argument for `s` may
346
- introduce a data race [[res.on.data.races]] with other calls to
347
- `c8rtomb` with a null pointer argument for `s`.
348
 
349
  <!-- Link reference definitions -->
350
  [basic.indet]: basic.md#basic.indet
351
  [basic.string]: #basic.string
352
  [basic.string.general]: #basic.string.general
353
  [basic.string.hash]: #basic.string.hash
354
  [basic.string.literals]: #basic.string.literals
355
- [c.mb.wcs]: #c.mb.wcs
356
  [c.strings]: #c.strings
357
- [cctype.syn]: #cctype.syn
358
  [char.traits]: #char.traits
359
  [char.traits.general]: #char.traits.general
360
  [char.traits.req]: #char.traits.req
361
  [char.traits.require]: #char.traits.require
362
  [char.traits.specializations]: #char.traits.specializations
@@ -366,21 +81,19 @@ introduce a data race [[res.on.data.races]] with other calls to
366
  [char.traits.specializations.char8.t]: #char.traits.specializations.char8.t
367
  [char.traits.specializations.general]: #char.traits.specializations.general
368
  [char.traits.specializations.wchar.t]: #char.traits.specializations.wchar.t
369
  [char.traits.typedefs]: #char.traits.typedefs
370
  [cmp.categories]: support.md#cmp.categories
 
371
  [container.reqmts]: containers.md#container.reqmts
372
  [container.requirements]: containers.md#container.requirements
373
- [container.requirements.general]: containers.md#container.requirements.general
374
  [cpp17.copyassignable]: #cpp17.copyassignable
375
  [cpp17.copyconstructible]: #cpp17.copyconstructible
376
  [cpp17.defaultconstructible]: #cpp17.defaultconstructible
377
  [cpp17.destructible]: #cpp17.destructible
378
  [cstring.syn]: #cstring.syn
379
- [cuchar.syn]: #cuchar.syn
380
- [cwchar.syn]: #cwchar.syn
381
- [cwctype.syn]: #cwctype.syn
382
  [defns.character.container]: intro.md#defns.character.container
383
  [input.output]: input.md#input.output
384
  [intro.object]: basic.md#intro.object
385
  [iostream.forward]: input.md#iostream.forward
386
  [iostreams.limits.pos]: input.md#iostreams.limits.pos
@@ -390,10 +103,11 @@ introduce a data race [[res.on.data.races]] with other calls to
390
  [iterator.concept.winc]: iterators.md#iterator.concept.winc
391
  [iterator.range]: iterators.md#iterator.range
392
  [iterator.requirements.general]: iterators.md#iterator.requirements.general
393
  [library.c]: library.md#library.c
394
  [ostream.formatted.reqmts]: input.md#ostream.formatted.reqmts
 
395
  [random.access.iterators]: iterators.md#random.access.iterators
396
  [res.on.data.races]: library.md#res.on.data.races
397
  [sequence.reqmts]: containers.md#sequence.reqmts
398
  [string.access]: #string.access
399
  [string.accessors]: #string.accessors
@@ -430,11 +144,10 @@ introduce a data race [[res.on.data.races]] with other calls to
430
  [string.view]: #string.view
431
  [string.view.access]: #string.view.access
432
  [string.view.capacity]: #string.view.capacity
433
  [string.view.compare]: #string.view.compare
434
  [string.view.comparison]: #string.view.comparison
435
- [string.view.comparison.overloads]: #string.view.comparison.overloads
436
  [string.view.cons]: #string.view.cons
437
  [string.view.deduct]: #string.view.deduct
438
  [string.view.find]: #string.view.find
439
  [string.view.general]: #string.view.general
440
  [string.view.hash]: #string.view.hash
 
1
  ## Null-terminated sequence utilities <a id="c.strings">[[c.strings]]</a>
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ### Header `<cstring>` synopsis <a id="cstring.syn">[[cstring.syn]]</a>
4
 
5
  ``` cpp
6
+ #define __STDC_VERSION_STRING_H__ 202311L
7
+
8
  namespace std {
9
+ using size_t = see [support.types.layout]; // freestanding
10
 
11
+ void* memcpy(void* s1, const void* s2, size_t n); // freestanding
12
+ void* memccpy(void* s1, const void* s2, int c, size_t n); // freestanding
13
+ void* memmove(void* s1, const void* s2, size_t n); // freestanding
14
+ char* strcpy(char* s1, const char* s2); // freestanding
15
+ char* strncpy(char* s1, const char* s2, size_t n); // freestanding
16
+ char* strdup(const char* s);
17
+ char* strndup(const char* s, size_t size);
18
+ char* strcat(char* s1, const char* s2); // freestanding
19
+ char* strncat(char* s1, const char* s2, size_t n); // freestanding
20
+ int memcmp(const void* s1, const void* s2, size_t n); // freestanding
21
+ int strcmp(const char* s1, const char* s2); // freestanding
22
  int strcoll(const char* s1, const char* s2);
23
+ int strncmp(const char* s1, const char* s2, size_t n); // freestanding
24
  size_t strxfrm(char* s1, const char* s2, size_t n);
25
+ const void* memchr(const void* s, int c, size_t n); // freestanding; see [library.c]
26
+ void* memchr(void* s, int c, size_t n); // freestanding; see [library.c]
27
+ const char* strchr(const char* s, int c); // freestanding; see [library.c]
28
+ char* strchr(char* s, int c); // freestanding; see [library.c]
29
+ size_t strcspn(const char* s1, const char* s2); // freestanding
30
+ const char* strpbrk(const char* s1, const char* s2); // freestanding; see [library.c]
31
+ char* strpbrk(char* s1, const char* s2); // freestanding; see [library.c]
32
+ const char* strrchr(const char* s, int c); // freestanding; see [library.c]
33
+ char* strrchr(char* s, int c); // freestanding; see [library.c]
34
+ size_t strspn(const char* s1, const char* s2); // freestanding
35
+ const char* strstr(const char* s1, const char* s2); // freestanding; see [library.c]
36
+ char* strstr(char* s1, const char* s2); // freestanding; see [library.c]
37
  char* strtok(char* s1, const char* s2);
38
+ void* memset(void* s, int c, size_t n); // freestanding
39
+ void* memset_explicit(void* s, int c, size_t n); // freestanding
40
  char* strerror(int errnum);
41
+ size_t strlen(const char* s); // freestanding
42
  }
43
 
44
+ #define NULL see [support.types.nullptr] // freestanding
45
  ```
46
 
47
  The contents and meaning of the header `<cstring>` are the same as the C
48
  standard library header `<string.h>`.
49
 
50
  The functions `strerror` and `strtok` are not required to avoid data
51
  races [[res.on.data.races]].
52
 
53
  The functions `memcpy` and `memmove` are signal-safe [[support.signal]].
54
+ Each of these functions implicitly creates objects [[intro.object]] in
55
+ the destination region of storage immediately prior to copying the
56
+ sequence of characters to the destination. Each of these functions
57
+ returns a pointer to a suitable created object, if any, otherwise the
58
+ value of the first parameter.
59
 
60
  [*Note 1*: The functions `strchr`, `strpbrk`, `strrchr`, `strstr`, and
61
  `memchr`, have different signatures in this document, but they have the
62
  same behavior as in the C standard library [[library.c]]. — *end note*]
63
 
64
+ See also: ISO C 7.26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  <!-- Link reference definitions -->
67
  [basic.indet]: basic.md#basic.indet
68
  [basic.string]: #basic.string
69
  [basic.string.general]: #basic.string.general
70
  [basic.string.hash]: #basic.string.hash
71
  [basic.string.literals]: #basic.string.literals
 
72
  [c.strings]: #c.strings
 
73
  [char.traits]: #char.traits
74
  [char.traits.general]: #char.traits.general
75
  [char.traits.req]: #char.traits.req
76
  [char.traits.require]: #char.traits.require
77
  [char.traits.specializations]: #char.traits.specializations
 
81
  [char.traits.specializations.char8.t]: #char.traits.specializations.char8.t
82
  [char.traits.specializations.general]: #char.traits.specializations.general
83
  [char.traits.specializations.wchar.t]: #char.traits.specializations.wchar.t
84
  [char.traits.typedefs]: #char.traits.typedefs
85
  [cmp.categories]: support.md#cmp.categories
86
+ [container.alloc.reqmts]: containers.md#container.alloc.reqmts
87
  [container.reqmts]: containers.md#container.reqmts
88
  [container.requirements]: containers.md#container.requirements
89
+ [container.requirements.pre]: containers.md#container.requirements.pre
90
  [cpp17.copyassignable]: #cpp17.copyassignable
91
  [cpp17.copyconstructible]: #cpp17.copyconstructible
92
  [cpp17.defaultconstructible]: #cpp17.defaultconstructible
93
  [cpp17.destructible]: #cpp17.destructible
94
  [cstring.syn]: #cstring.syn
 
 
 
95
  [defns.character.container]: intro.md#defns.character.container
96
  [input.output]: input.md#input.output
97
  [intro.object]: basic.md#intro.object
98
  [iostream.forward]: input.md#iostream.forward
99
  [iostreams.limits.pos]: input.md#iostreams.limits.pos
 
103
  [iterator.concept.winc]: iterators.md#iterator.concept.winc
104
  [iterator.range]: iterators.md#iterator.range
105
  [iterator.requirements.general]: iterators.md#iterator.requirements.general
106
  [library.c]: library.md#library.c
107
  [ostream.formatted.reqmts]: input.md#ostream.formatted.reqmts
108
+ [over.match.oper]: over.md#over.match.oper
109
  [random.access.iterators]: iterators.md#random.access.iterators
110
  [res.on.data.races]: library.md#res.on.data.races
111
  [sequence.reqmts]: containers.md#sequence.reqmts
112
  [string.access]: #string.access
113
  [string.accessors]: #string.accessors
 
144
  [string.view]: #string.view
145
  [string.view.access]: #string.view.access
146
  [string.view.capacity]: #string.view.capacity
147
  [string.view.compare]: #string.view.compare
148
  [string.view.comparison]: #string.view.comparison
 
149
  [string.view.cons]: #string.view.cons
150
  [string.view.deduct]: #string.view.deduct
151
  [string.view.find]: #string.view.find
152
  [string.view.general]: #string.view.general
153
  [string.view.hash]: #string.view.hash