- tmp/tmpza_h4k4w/{from.md → to.md} +313 -143
tmp/tmpza_h4k4w/{from.md → to.md}
RENAMED
|
@@ -1,237 +1,407 @@
|
|
| 1 |
## Null-terminated sequence utilities <a id="c.strings">[[c.strings]]</a>
|
| 2 |
|
| 3 |
-
|
| 4 |
-
[[tab:strings.hdr.cstring]], [[tab:strings.hdr.cwchar]],
|
| 5 |
-
[[tab:strings.hdr.cstdlib]], and [[tab:strings.hdr.cuchar]] describe
|
| 6 |
-
headers `<cctype>`, `<cwctype>`, `<cstring>`, `<cwchar>`, `<cstdlib>`
|
| 7 |
-
(character conversions), and `<cuchar>`, respectively.
|
| 8 |
-
|
| 9 |
-
The contents of these headers shall be the same as the Standard C
|
| 10 |
-
Library headers `<ctype.h>`, `<wctype.h>`, `<string.h>`, `<wchar.h>`,
|
| 11 |
-
and `<stdlib.h>` and the C Unicode TR header `<uchar.h>`, respectively,
|
| 12 |
-
with the following modifications:
|
| 13 |
-
|
| 14 |
-
The headers shall not define the types `char16_t`, `char32_t`, and
|
| 15 |
-
`wchar_t` ([[lex.key]]).
|
| 16 |
-
|
| 17 |
-
The function signature `strchr(const char*, int)` shall be replaced by
|
| 18 |
-
the two declarations:
|
| 19 |
-
|
| 20 |
-
``` cpp
|
| 21 |
-
const char* strchr(const char* s, int c);
|
| 22 |
-
char* strchr( char* s, int c);
|
| 23 |
-
```
|
| 24 |
-
|
| 25 |
-
both of which shall have the same behavior as the original declaration.
|
| 26 |
-
|
| 27 |
-
The function signature `strpbrk(const char*, const char*)` shall be
|
| 28 |
-
replaced by the two declarations:
|
| 29 |
-
|
| 30 |
-
``` cpp
|
| 31 |
-
const char* strpbrk(const char* s1, const char* s2);
|
| 32 |
-
char* strpbrk( char* s1, const char* s2);
|
| 33 |
-
```
|
| 34 |
-
|
| 35 |
-
both of which shall have the same behavior as the original declaration.
|
| 36 |
-
|
| 37 |
-
The function signature `strrchr(const char*, int)` shall be replaced by
|
| 38 |
-
the two declarations:
|
| 39 |
-
|
| 40 |
-
``` cpp
|
| 41 |
-
const char* strrchr(const char* s, int c);
|
| 42 |
-
char* strrchr( char* s, int c);
|
| 43 |
-
```
|
| 44 |
-
|
| 45 |
-
both of which shall have the same behavior as the original declaration.
|
| 46 |
-
|
| 47 |
-
The function signature `strstr(const char*, const char*)` shall be
|
| 48 |
-
replaced by the two declarations:
|
| 49 |
|
| 50 |
``` cpp
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
```
|
| 54 |
|
| 55 |
-
|
|
|
|
| 56 |
|
| 57 |
-
|
| 58 |
-
replaced by the two declarations:
|
| 59 |
|
| 60 |
-
``
|
| 61 |
-
const void* memchr(const void* s, int c, size_t n);
|
| 62 |
-
void* memchr( void* s, int c, size_t n);
|
| 63 |
-
```
|
| 64 |
-
|
| 65 |
-
both of which shall have the same behavior as the original declaration.
|
| 66 |
-
|
| 67 |
-
The function signature `wcschr(const wchar_t*, wchar_t)` shall be
|
| 68 |
-
replaced by the two declarations:
|
| 69 |
-
|
| 70 |
-
``` cpp
|
| 71 |
-
const wchar_t* wcschr(const wchar_t* s, wchar_t c);
|
| 72 |
-
wchar_t* wcschr( wchar_t* s, wchar_t c);
|
| 73 |
-
```
|
| 74 |
-
|
| 75 |
-
both of which shall have the same behavior as the original declaration.
|
| 76 |
-
|
| 77 |
-
The function signature `wcspbrk(const wchar_t*, const wchar_t*)` shall
|
| 78 |
-
be replaced by the two declarations:
|
| 79 |
|
| 80 |
``` cpp
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
```
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
The function signature `wcsrchr(const wchar_t*, wchar_t)` shall be
|
| 88 |
-
replaced by the two declarations:
|
| 89 |
-
|
| 90 |
-
``` cpp
|
| 91 |
-
const wchar_t* wcsrchr(const wchar_t* s, wchar_t c);
|
| 92 |
-
wchar_t* wcsrchr( wchar_t* s, wchar_t c);
|
| 93 |
-
```
|
| 94 |
-
|
| 95 |
-
both of which shall have the same behavior as the original declaration.
|
| 96 |
-
|
| 97 |
-
The function signature `wcsstr(const wchar_t*, const wchar_t*)` shall be
|
| 98 |
-
replaced by the two declarations:
|
| 99 |
-
|
| 100 |
-
``` cpp
|
| 101 |
-
const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2);
|
| 102 |
-
wchar_t* wcsstr( wchar_t* s1, const wchar_t* s2);
|
| 103 |
-
```
|
| 104 |
|
| 105 |
-
|
| 106 |
|
| 107 |
-
|
| 108 |
-
replaced by the two declarations:
|
| 109 |
|
| 110 |
``` cpp
|
| 111 |
-
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
```
|
| 114 |
|
| 115 |
-
|
|
|
|
| 116 |
|
| 117 |
The functions `strerror` and `strtok` are not required to avoid data
|
| 118 |
races ([[res.on.data.races]]).
|
| 119 |
|
| 120 |
-
|
| 121 |
-
an `mbstate_t*` argument of `NULL` may introduce a data race (
|
| 122 |
-
[[res.on.data.races]]) with other calls to these functions with an
|
| 123 |
-
`mbstate_t*` argument of `NULL`.
|
| 124 |
|
| 125 |
-
**
|
|
|
|
|
|
|
|
|
|
| 126 |
|
| 127 |
-
|
| 128 |
-
| ---------- | --------- | ---------- | -------- | --------- |
|
| 129 |
-
| `mbrlen` | `mbrtowc` | `mbsrtowc` | `mbtowc` | `wcrtomb` |
|
| 130 |
-
| `wcsrtomb` | `wctomb` | | | |
|
| 131 |
|
|
|
|
| 132 |
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
<!-- Link reference definitions -->
|
| 136 |
[basic.string]: #basic.string
|
| 137 |
[basic.string.hash]: #basic.string.hash
|
| 138 |
[basic.string.literals]: #basic.string.literals
|
| 139 |
[basic.types]: basic.md#basic.types
|
|
|
|
| 140 |
[c.strings]: #c.strings
|
|
|
|
| 141 |
[char.traits]: #char.traits
|
| 142 |
[char.traits.require]: #char.traits.require
|
| 143 |
[char.traits.specializations]: #char.traits.specializations
|
| 144 |
[char.traits.specializations.char]: #char.traits.specializations.char
|
| 145 |
[char.traits.specializations.char16_t]: #char.traits.specializations.char16_t
|
| 146 |
[char.traits.specializations.char32_t]: #char.traits.specializations.char32_t
|
| 147 |
[char.traits.specializations.wchar.t]: #char.traits.specializations.wchar.t
|
| 148 |
[char.traits.typedefs]: #char.traits.typedefs
|
|
|
|
| 149 |
[container.requirements.general]: containers.md#container.requirements.general
|
| 150 |
-
[
|
| 151 |
-
[
|
| 152 |
-
[
|
|
|
|
|
|
|
|
|
|
| 153 |
[input.output]: input.md#input.output
|
| 154 |
[iostate.flags]: input.md#iostate.flags
|
| 155 |
[iostream.forward]: input.md#iostream.forward
|
| 156 |
[iostreams.limits.pos]: input.md#iostreams.limits.pos
|
| 157 |
[istream.formatted.reqmts]: input.md#istream.formatted.reqmts
|
| 158 |
[istream.unformatted]: input.md#istream.unformatted
|
|
|
|
|
|
|
| 159 |
[length.error]: diagnostics.md#length.error
|
| 160 |
-
[
|
| 161 |
[ostream.formatted.reqmts]: input.md#ostream.formatted.reqmts
|
| 162 |
[out.of.range]: diagnostics.md#out.of.range
|
| 163 |
[random.access.iterators]: iterators.md#random.access.iterators
|
| 164 |
[res.on.data.races]: library.md#res.on.data.races
|
| 165 |
[sequence.reqmts]: containers.md#sequence.reqmts
|
| 166 |
[string.access]: #string.access
|
| 167 |
[string.accessors]: #string.accessors
|
|
|
|
|
|
|
| 168 |
[string.capacity]: #string.capacity
|
| 169 |
[string.classes]: #string.classes
|
|
|
|
| 170 |
[string.cons]: #string.cons
|
| 171 |
[string.conversions]: #string.conversions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
[string.io]: #string.io
|
| 173 |
[string.iterators]: #string.iterators
|
| 174 |
[string.modifiers]: #string.modifiers
|
| 175 |
[string.nonmembers]: #string.nonmembers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
[string.ops]: #string.ops
|
|
|
|
| 177 |
[string.require]: #string.require
|
|
|
|
| 178 |
[string.special]: #string.special
|
| 179 |
-
[string
|
| 180 |
-
[string
|
| 181 |
-
[string
|
| 182 |
-
[string
|
| 183 |
-
[string
|
| 184 |
-
[string
|
| 185 |
-
[string
|
| 186 |
-
[string
|
| 187 |
-
[string
|
| 188 |
-
[string
|
| 189 |
-
[string
|
| 190 |
-
[string
|
| 191 |
-
[string
|
| 192 |
-
[string
|
| 193 |
-
[string
|
| 194 |
-
[string
|
| 195 |
-
[string
|
| 196 |
-
[string::op>=]: #string::op>=
|
| 197 |
-
[string::operator==]: #string::operator==
|
| 198 |
-
[string::replace]: #string::replace
|
| 199 |
-
[string::rfind]: #string::rfind
|
| 200 |
-
[string::substr]: #string::substr
|
| 201 |
-
[string::swap]: #string::swap
|
| 202 |
[strings]: #strings
|
| 203 |
[strings.general]: #strings.general
|
| 204 |
[tab:char.traits.require]: #tab:char.traits.require
|
| 205 |
-
[tab:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
[tab:strings.compare]: #tab:strings.compare
|
| 207 |
[tab:strings.ctr.1]: #tab:strings.ctr.1
|
| 208 |
[tab:strings.ctr.2]: #tab:strings.ctr.2
|
| 209 |
[tab:strings.ctr.3]: #tab:strings.ctr.3
|
| 210 |
[tab:strings.ctr.4]: #tab:strings.ctr.4
|
| 211 |
[tab:strings.ctr.5]: #tab:strings.ctr.5
|
| 212 |
[tab:strings.ctr.6]: #tab:strings.ctr.6
|
| 213 |
[tab:strings.ctr.cpy]: #tab:strings.ctr.cpy
|
| 214 |
-
[tab:strings.hdr.cctype]: #tab:strings.hdr.cctype
|
| 215 |
-
[tab:strings.hdr.cstdlib]: #tab:strings.hdr.cstdlib
|
| 216 |
-
[tab:strings.hdr.cstring]: #tab:strings.hdr.cstring
|
| 217 |
-
[tab:strings.hdr.cuchar]: #tab:strings.hdr.cuchar
|
| 218 |
-
[tab:strings.hdr.cwchar]: #tab:strings.hdr.cwchar
|
| 219 |
-
[tab:strings.hdr.cwctype]: #tab:strings.hdr.cwctype
|
| 220 |
[tab:strings.lib.summary]: #tab:strings.lib.summary
|
| 221 |
[tab:strings.op=]: #tab:strings.op=
|
| 222 |
-
[tab:strings.op=rv]: #tab:strings.op=rv
|
| 223 |
[unord.hash]: utilities.md#unord.hash
|
|
|
|
| 224 |
|
| 225 |
[^1]: If `eof()` can be held in `char_type` then some iostreams
|
| 226 |
operations may give surprising results.
|
| 227 |
|
| 228 |
[^2]: `Allocator::value_type` must name the same type as `charT` (
|
| 229 |
[[string.require]]).
|
| 230 |
|
| 231 |
[^3]: For example, as an argument to non-member functions `swap()` (
|
| 232 |
[[string.special]]), `operator>{}>()` ([[string.io]]), and
|
| 233 |
`getline()` ([[string.io]]), or as an argument to
|
| 234 |
-
`basic_string::swap()`
|
| 235 |
|
| 236 |
[^4]: `reserve()` uses `allocator_traits<Allocator>::allocate()` which
|
| 237 |
may throw an appropriate exception.
|
|
|
|
| 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 |
+
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 |
+
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 ([[csignal.syn]]).
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
+
[*Note 1*: The functions `strchr`, `strpbrk`, `strrchr`, `strstr`, and
|
| 112 |
+
`memchr`, have different signatures in this International Standard, but
|
| 113 |
+
they have the same behavior as in the C standard library (
|
| 114 |
+
[[library.c]]). — *end note*]
|
| 115 |
|
| 116 |
+
ISO C 7.24.
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
+
### Header `<cwchar>` synopsis <a id="cwchar.syn">[[cwchar.syn]]</a>
|
| 119 |
|
| 120 |
+
``` cpp
|
| 121 |
+
namespace std {
|
| 122 |
+
using size_t = see [support.types.layout];
|
| 123 |
+
using mbstate_t = see below;
|
| 124 |
+
using wint_t = see below;
|
| 125 |
+
|
| 126 |
+
struct tm;
|
| 127 |
+
|
| 128 |
+
int fwprintf(FILE* stream, const wchar_t* format, ...);
|
| 129 |
+
int fwscanf(FILE* stream, const wchar_t* format, ...);
|
| 130 |
+
int swprintf(wchar_t* s, size_t n, const wchar_t* format, ...);
|
| 131 |
+
int swscanf(const wchar_t* s, const wchar_t* format, ...);
|
| 132 |
+
int vfwprintf(FILE* stream, const wchar_t* format, va_list arg);
|
| 133 |
+
int vfwscanf(FILE* stream, const wchar_t* format, va_list arg);
|
| 134 |
+
int vswprintf(wchar_t* s, size_t n, const wchar_t* format, va_list arg);
|
| 135 |
+
int vswscanf(const wchar_t* s, const wchar_t* format, va_list arg);
|
| 136 |
+
int vwprintf(const wchar_t* format, va_list arg);
|
| 137 |
+
int vwscanf(const wchar_t* format, va_list arg);
|
| 138 |
+
int wprintf(const wchar_t* format, ...);
|
| 139 |
+
int wscanf(const wchar_t* format, ...);
|
| 140 |
+
wint_t fgetwc(FILE* stream);
|
| 141 |
+
wchar_t* fgetws(wchar_t* s, int n, FILE* stream);
|
| 142 |
+
wint_t fputwc(wchar_t c, FILE* stream);
|
| 143 |
+
int fputws(const wchar_t* s, FILE* stream);
|
| 144 |
+
int fwide(FILE* stream, int mode);
|
| 145 |
+
wint_t getwc(FILE* stream);
|
| 146 |
+
wint_t getwchar();
|
| 147 |
+
wint_t putwc(wchar_t c, FILE* stream);
|
| 148 |
+
wint_t putwchar(wchar_t c);
|
| 149 |
+
wint_t ungetwc(wint_t c, FILE* stream);
|
| 150 |
+
double wcstod(const wchar_t* nptr, wchar_t** endptr);
|
| 151 |
+
float wcstof(const wchar_t* nptr, wchar_t** endptr);
|
| 152 |
+
long double wcstold(const wchar_t* nptr, wchar_t** endptr);
|
| 153 |
+
long int wcstol(const wchar_t* nptr, wchar_t** endptr, int base);
|
| 154 |
+
long long int wcstoll(const wchar_t* nptr, wchar_t** endptr, int base);
|
| 155 |
+
unsigned long int wcstoul(const wchar_t* nptr, wchar_t** endptr, int base);
|
| 156 |
+
unsigned long long int wcstoull(const wchar_t* nptr, wchar_t** endptr, int base);
|
| 157 |
+
wchar_t* wcscpy(wchar_t* s1, const wchar_t* s2);
|
| 158 |
+
wchar_t* wcsncpy(wchar_t* s1, const wchar_t* s2, size_t n);
|
| 159 |
+
wchar_t* wmemcpy(wchar_t* s1, const wchar_t* s2, size_t n);
|
| 160 |
+
wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n);
|
| 161 |
+
wchar_t* wcscat(wchar_t* s1, const wchar_t* s2);
|
| 162 |
+
wchar_t* wcsncat(wchar_t* s1, const wchar_t* s2, size_t n);
|
| 163 |
+
int wcscmp(const wchar_t* s1, const wchar_t* s2);
|
| 164 |
+
int wcscoll(const wchar_t* s1, const wchar_t* s2);
|
| 165 |
+
int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n);
|
| 166 |
+
size_t wcsxfrm(wchar_t* s1, const wchar_t* s2, size_t n);
|
| 167 |
+
int wmemcmp(const wchar_t* s1, const wchar_t* s2, size_t n);
|
| 168 |
+
const wchar_t* wcschr(const wchar_t* s, wchar_t c) // see [library.c]
|
| 169 |
+
wchar_t* wcschr(wchar_t* s, wchar_t c) // see [library.c]
|
| 170 |
+
size_t wcscspn(const wchar_t* s1, const wchar_t* s2);
|
| 171 |
+
const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2) // see [library.c]
|
| 172 |
+
wchar_t* wcspbrk(wchar_t* s1, const wchar_t* s2) // see [library.c]
|
| 173 |
+
const wchar_t* wcsrchr(const wchar_t* s, wchar_t c) // see [library.c]
|
| 174 |
+
wchar_t* wcsrchr(wchar_t* s, wchar_t c) // see [library.c]
|
| 175 |
+
size_t wcsspn(const wchar_t* s1, const wchar_t* s2);
|
| 176 |
+
const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2) // see [library.c]
|
| 177 |
+
wchar_t* wcsstr(wchar_t* s1, const wchar_t* s2) // see [library.c]
|
| 178 |
+
wchar_t* wcstok(wchar_t* s1, const wchar_t* s2, wchar_t** ptr);
|
| 179 |
+
const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n) // see [library.c]
|
| 180 |
+
wchar_t* wmemchr(wchar_t* s, wchar_t c, size_t n) // see [library.c]
|
| 181 |
+
size_t wcslen(const wchar_t* s);
|
| 182 |
+
wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n);
|
| 183 |
+
size_t wcsftime(wchar_t* s, size_t maxsize, const wchar_t* format, const struct tm* timeptr);
|
| 184 |
+
wint_t btowc(int c);
|
| 185 |
+
int wctob(wint_t c);
|
| 186 |
+
|
| 187 |
+
// [c.mb.wcs], multibyte / wide string and character conversion functions
|
| 188 |
+
int mbsinit(const mbstate_t* ps);
|
| 189 |
+
size_t mbrlen(const char* s, size_t n, mbstate_t* ps);
|
| 190 |
+
size_t mbrtowc(wchar_t* pwc, const char* s, size_t n, mbstate_t* ps);
|
| 191 |
+
size_t wcrtomb(char* s, wchar_t wc, mbstate_t* ps);
|
| 192 |
+
size_t mbsrtowcs(wchar_t* dst, const char** src, size_t len, mbstate_t* ps);
|
| 193 |
+
size_t wcsrtombs(char* dst, const wchar_t** src, size_t len, mbstate_t* ps);
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
#define NULL see [support.types.nullptr]
|
| 197 |
+
#define WCHAR_MAX see below
|
| 198 |
+
#define WCHAR_MIN see below
|
| 199 |
+
#define WEOF see below
|
| 200 |
+
```
|
| 201 |
+
|
| 202 |
+
The contents and meaning of the header `<cwchar>` are the same as the C
|
| 203 |
+
standard library header `<wchar.h>`, except that it does not declare a
|
| 204 |
+
type `wchar_t`.
|
| 205 |
+
|
| 206 |
+
[*Note 1*: The functions `wcschr`, `wcspbrk`, `wcsrchr`, `wcsstr`, and
|
| 207 |
+
`wmemchr` have different signatures in this International Standard, but
|
| 208 |
+
they have the same behavior as in the C standard library (
|
| 209 |
+
[[library.c]]). — *end note*]
|
| 210 |
+
|
| 211 |
+
ISO C 7.29
|
| 212 |
+
|
| 213 |
+
### Header `<cuchar>` synopsis <a id="cuchar.syn">[[cuchar.syn]]</a>
|
| 214 |
+
|
| 215 |
+
``` cpp
|
| 216 |
+
namespace std {
|
| 217 |
+
using mbstate_t = see below;
|
| 218 |
+
using size_t = see [support.types.layout];
|
| 219 |
+
|
| 220 |
+
size_t mbrtoc16(char16_t* pc16, const char* s, size_t n, mbstate_t* ps);
|
| 221 |
+
size_t c16rtomb(char* s, char16_t c16, mbstate_t* ps);
|
| 222 |
+
size_t mbrtoc32(char32_t* pc32, const char* s, size_t n, mbstate_t* ps);
|
| 223 |
+
size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);
|
| 224 |
+
}
|
| 225 |
+
```
|
| 226 |
+
|
| 227 |
+
The contents and meaning of the header `<cuchar>` are the same as the C
|
| 228 |
+
standard library header `<uchar.h>`, except that it does not declare
|
| 229 |
+
types `char16_t` nor `char32_t`.
|
| 230 |
+
|
| 231 |
+
ISO C 7.28
|
| 232 |
+
|
| 233 |
+
### Multibyte / wide string and character conversion functions <a id="c.mb.wcs">[[c.mb.wcs]]</a>
|
| 234 |
+
|
| 235 |
+
[*Note 1*: The headers `<cstdlib>` ([[cstdlib.syn]]) and `<cwchar>` (
|
| 236 |
+
[[cwchar.syn]]) declare the functions described in this
|
| 237 |
+
subclause. — *end note*]
|
| 238 |
+
|
| 239 |
+
``` cpp
|
| 240 |
+
int mbsinit(const mbstate_t* ps);
|
| 241 |
+
int mblen(const char* s, size_t n);
|
| 242 |
+
size_t mbstowcs(wchar_t* pwcs, const char* s, size_t n);
|
| 243 |
+
size_t wcstombs(char* s, const wchar_t* pwcs, size_t n);
|
| 244 |
+
```
|
| 245 |
+
|
| 246 |
+
*Effects:* These functions have the semantics specified in the C
|
| 247 |
+
standard library.
|
| 248 |
+
|
| 249 |
+
ISO C 7.22.7.1, 7.22.8, 7.29.6.2.1
|
| 250 |
+
|
| 251 |
+
``` cpp
|
| 252 |
+
int mbtowc(wchar_t* pwc, const char* s, size_t n);
|
| 253 |
+
int wctomb(char* s, wchar_t wchar);
|
| 254 |
+
```
|
| 255 |
+
|
| 256 |
+
*Effects:* These functions have the semantics specified in the C
|
| 257 |
+
standard library.
|
| 258 |
+
|
| 259 |
+
*Remarks:* Calls to these functions may introduce a data
|
| 260 |
+
race ([[res.on.data.races]]) with other calls to the same function.
|
| 261 |
+
|
| 262 |
+
ISO C 7.22.7
|
| 263 |
+
|
| 264 |
+
``` cpp
|
| 265 |
+
size_t mbrlen(const char* s, size_t n, mbstate_t* ps);
|
| 266 |
+
size_t mbrtowc(wchar_t* pwc, const char* s, size_t n, mbstate_t* ps);
|
| 267 |
+
size_t wcrtomb(char* s, wchar_t wc, mbstate_t* ps);
|
| 268 |
+
size_t mbsrtowcs(wchar_t* dst, const char** src, size_t len, mbstate_t* ps);
|
| 269 |
+
size_t wcsrtombs(char* dst, const wchar_t** src, size_t len, mbstate_t* ps);
|
| 270 |
+
```
|
| 271 |
+
|
| 272 |
+
*Effects:* These functions have the semantics specified in the C
|
| 273 |
+
standard library.
|
| 274 |
+
|
| 275 |
+
*Remarks:* Calling these functions with an `mbstate_t*` argument that is
|
| 276 |
+
a null pointer value may introduce a data race ([[res.on.data.races]])
|
| 277 |
+
with other calls to the same function with an `mbstate_t*` argument that
|
| 278 |
+
is a null pointer value.
|
| 279 |
+
|
| 280 |
+
ISO C 7.29.6.3
|
| 281 |
|
| 282 |
<!-- Link reference definitions -->
|
| 283 |
[basic.string]: #basic.string
|
| 284 |
[basic.string.hash]: #basic.string.hash
|
| 285 |
[basic.string.literals]: #basic.string.literals
|
| 286 |
[basic.types]: basic.md#basic.types
|
| 287 |
+
[c.mb.wcs]: #c.mb.wcs
|
| 288 |
[c.strings]: #c.strings
|
| 289 |
+
[cctype.syn]: #cctype.syn
|
| 290 |
[char.traits]: #char.traits
|
| 291 |
[char.traits.require]: #char.traits.require
|
| 292 |
[char.traits.specializations]: #char.traits.specializations
|
| 293 |
[char.traits.specializations.char]: #char.traits.specializations.char
|
| 294 |
[char.traits.specializations.char16_t]: #char.traits.specializations.char16_t
|
| 295 |
[char.traits.specializations.char32_t]: #char.traits.specializations.char32_t
|
| 296 |
[char.traits.specializations.wchar.t]: #char.traits.specializations.wchar.t
|
| 297 |
[char.traits.typedefs]: #char.traits.typedefs
|
| 298 |
+
[container.requirements]: containers.md#container.requirements
|
| 299 |
[container.requirements.general]: containers.md#container.requirements.general
|
| 300 |
+
[csignal.syn]: language.md#csignal.syn
|
| 301 |
+
[cstdlib.syn]: language.md#cstdlib.syn
|
| 302 |
+
[cstring.syn]: #cstring.syn
|
| 303 |
+
[cuchar.syn]: #cuchar.syn
|
| 304 |
+
[cwchar.syn]: #cwchar.syn
|
| 305 |
+
[cwctype.syn]: #cwctype.syn
|
| 306 |
[input.output]: input.md#input.output
|
| 307 |
[iostate.flags]: input.md#iostate.flags
|
| 308 |
[iostream.forward]: input.md#iostream.forward
|
| 309 |
[iostreams.limits.pos]: input.md#iostreams.limits.pos
|
| 310 |
[istream.formatted.reqmts]: input.md#istream.formatted.reqmts
|
| 311 |
[istream.unformatted]: input.md#istream.unformatted
|
| 312 |
+
[iterator.range]: iterators.md#iterator.range
|
| 313 |
+
[iterator.requirements.general]: iterators.md#iterator.requirements.general
|
| 314 |
[length.error]: diagnostics.md#length.error
|
| 315 |
+
[library.c]: library.md#library.c
|
| 316 |
[ostream.formatted.reqmts]: input.md#ostream.formatted.reqmts
|
| 317 |
[out.of.range]: diagnostics.md#out.of.range
|
| 318 |
[random.access.iterators]: iterators.md#random.access.iterators
|
| 319 |
[res.on.data.races]: library.md#res.on.data.races
|
| 320 |
[sequence.reqmts]: containers.md#sequence.reqmts
|
| 321 |
[string.access]: #string.access
|
| 322 |
[string.accessors]: #string.accessors
|
| 323 |
+
[string.append]: #string.append
|
| 324 |
+
[string.assign]: #string.assign
|
| 325 |
[string.capacity]: #string.capacity
|
| 326 |
[string.classes]: #string.classes
|
| 327 |
+
[string.compare]: #string.compare
|
| 328 |
[string.cons]: #string.cons
|
| 329 |
[string.conversions]: #string.conversions
|
| 330 |
+
[string.copy]: #string.copy
|
| 331 |
+
[string.erase]: #string.erase
|
| 332 |
+
[string.find]: #string.find
|
| 333 |
+
[string.find.first.not.of]: #string.find.first.not.of
|
| 334 |
+
[string.find.first.of]: #string.find.first.of
|
| 335 |
+
[string.find.last.not.of]: #string.find.last.not.of
|
| 336 |
+
[string.find.last.of]: #string.find.last.of
|
| 337 |
+
[string.insert]: #string.insert
|
| 338 |
[string.io]: #string.io
|
| 339 |
[string.iterators]: #string.iterators
|
| 340 |
[string.modifiers]: #string.modifiers
|
| 341 |
[string.nonmembers]: #string.nonmembers
|
| 342 |
+
[string.op!=]: #string.op!=
|
| 343 |
+
[string.op+]: #string.op+
|
| 344 |
+
[string.op+=]: #string.op+=
|
| 345 |
+
[string.op<]: #string.op<
|
| 346 |
+
[string.op<=]: #string.op<=
|
| 347 |
+
[string.op>]: #string.op>
|
| 348 |
+
[string.op>=]: #string.op>=
|
| 349 |
+
[string.operator==]: #string.operator==
|
| 350 |
[string.ops]: #string.ops
|
| 351 |
+
[string.replace]: #string.replace
|
| 352 |
[string.require]: #string.require
|
| 353 |
+
[string.rfind]: #string.rfind
|
| 354 |
[string.special]: #string.special
|
| 355 |
+
[string.substr]: #string.substr
|
| 356 |
+
[string.swap]: #string.swap
|
| 357 |
+
[string.syn]: #string.syn
|
| 358 |
+
[string.view]: #string.view
|
| 359 |
+
[string.view.access]: #string.view.access
|
| 360 |
+
[string.view.capacity]: #string.view.capacity
|
| 361 |
+
[string.view.comparison]: #string.view.comparison
|
| 362 |
+
[string.view.cons]: #string.view.cons
|
| 363 |
+
[string.view.find]: #string.view.find
|
| 364 |
+
[string.view.hash]: #string.view.hash
|
| 365 |
+
[string.view.io]: #string.view.io
|
| 366 |
+
[string.view.iterators]: #string.view.iterators
|
| 367 |
+
[string.view.literals]: #string.view.literals
|
| 368 |
+
[string.view.modifiers]: #string.view.modifiers
|
| 369 |
+
[string.view.ops]: #string.view.ops
|
| 370 |
+
[string.view.synop]: #string.view.synop
|
| 371 |
+
[string.view.template]: #string.view.template
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 372 |
[strings]: #strings
|
| 373 |
[strings.general]: #strings.general
|
| 374 |
[tab:char.traits.require]: #tab:char.traits.require
|
| 375 |
+
[tab:copyassignable]: #tab:copyassignable
|
| 376 |
+
[tab:copyconstructible]: #tab:copyconstructible
|
| 377 |
+
[tab:defaultconstructible]: #tab:defaultconstructible
|
| 378 |
+
[tab:string.view.compare]: #tab:string.view.compare
|
| 379 |
+
[tab:string.view.comparison.overloads]: #tab:string.view.comparison.overloads
|
| 380 |
+
[tab:string.view.ctr.2]: #tab:string.view.ctr.2
|
| 381 |
+
[tab:string.view.ctr.3]: #tab:string.view.ctr.3
|
| 382 |
[tab:strings.compare]: #tab:strings.compare
|
| 383 |
[tab:strings.ctr.1]: #tab:strings.ctr.1
|
| 384 |
[tab:strings.ctr.2]: #tab:strings.ctr.2
|
| 385 |
[tab:strings.ctr.3]: #tab:strings.ctr.3
|
| 386 |
[tab:strings.ctr.4]: #tab:strings.ctr.4
|
| 387 |
[tab:strings.ctr.5]: #tab:strings.ctr.5
|
| 388 |
[tab:strings.ctr.6]: #tab:strings.ctr.6
|
| 389 |
[tab:strings.ctr.cpy]: #tab:strings.ctr.cpy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 390 |
[tab:strings.lib.summary]: #tab:strings.lib.summary
|
| 391 |
[tab:strings.op=]: #tab:strings.op=
|
|
|
|
| 392 |
[unord.hash]: utilities.md#unord.hash
|
| 393 |
+
[utility.swap]: utilities.md#utility.swap
|
| 394 |
|
| 395 |
[^1]: If `eof()` can be held in `char_type` then some iostreams
|
| 396 |
operations may give surprising results.
|
| 397 |
|
| 398 |
[^2]: `Allocator::value_type` must name the same type as `charT` (
|
| 399 |
[[string.require]]).
|
| 400 |
|
| 401 |
[^3]: For example, as an argument to non-member functions `swap()` (
|
| 402 |
[[string.special]]), `operator>{}>()` ([[string.io]]), and
|
| 403 |
`getline()` ([[string.io]]), or as an argument to
|
| 404 |
+
`basic_string::swap()`.
|
| 405 |
|
| 406 |
[^4]: `reserve()` uses `allocator_traits<Allocator>::allocate()` which
|
| 407 |
may throw an appropriate exception.
|