From Jason Turner

[string.syn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpgkktrz06/{from.md → to.md} +227 -0
tmp/tmpgkktrz06/{from.md → to.md} RENAMED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Header `<string>` synopsis <a id="string.syn">[[string.syn]]</a>
2
+
3
+ ``` cpp
4
+ #include <initializer_list>
5
+
6
+ namespace std {
7
+ // [char.traits], character traits
8
+ template<class charT> struct char_traits;
9
+ template<> struct char_traits<char>;
10
+ template<> struct char_traits<char16_t>;
11
+ template<> struct char_traits<char32_t>;
12
+ template<> struct char_traits<wchar_t>;
13
+
14
+ // [basic.string], basic_string
15
+ template<class charT, class traits = char_traits<charT>,
16
+ class Allocator = allocator<charT>>
17
+ class basic_string;
18
+
19
+ template<class charT, class traits, class Allocator>
20
+ basic_string<charT, traits, Allocator>
21
+ operator+(const basic_string<charT, traits, Allocator>& lhs,
22
+ const basic_string<charT, traits, Allocator>& rhs);
23
+ template<class charT, class traits, class Allocator>
24
+ basic_string<charT, traits, Allocator>
25
+ operator+(basic_string<charT, traits, Allocator>&& lhs,
26
+ const basic_string<charT, traits, Allocator>& rhs);
27
+ template<class charT, class traits, class Allocator>
28
+ basic_string<charT, traits, Allocator>
29
+ operator+(const basic_string<charT, traits, Allocator>& lhs,
30
+ basic_string<charT, traits, Allocator>&& rhs);
31
+ template<class charT, class traits, class Allocator>
32
+ basic_string<charT, traits, Allocator>
33
+ operator+(basic_string<charT, traits, Allocator>&& lhs,
34
+ basic_string<charT, traits, Allocator>&& rhs);
35
+ template<class charT, class traits, class Allocator>
36
+ basic_string<charT, traits, Allocator>
37
+ operator+(const charT* lhs,
38
+ const basic_string<charT, traits, Allocator>& rhs);
39
+ template<class charT, class traits, class Allocator>
40
+ basic_string<charT, traits, Allocator>
41
+ operator+(const charT* lhs,
42
+ basic_string<charT, traits, Allocator>&& rhs);
43
+ template<class charT, class traits, class Allocator>
44
+ basic_string<charT, traits, Allocator>
45
+ operator+(charT lhs, const basic_string<charT, traits, Allocator>& rhs);
46
+ template<class charT, class traits, class Allocator>
47
+ basic_string<charT, traits, Allocator>
48
+ operator+(charT lhs, basic_string<charT, traits, Allocator>&& rhs);
49
+ template<class charT, class traits, class Allocator>
50
+ basic_string<charT, traits, Allocator>
51
+ operator+(const basic_string<charT, traits, Allocator>& lhs,
52
+ const charT* rhs);
53
+ template<class charT, class traits, class Allocator>
54
+ basic_string<charT, traits, Allocator>
55
+ operator+(basic_string<charT, traits, Allocator>&& lhs,
56
+ const charT* rhs);
57
+ template<class charT, class traits, class Allocator>
58
+ basic_string<charT, traits, Allocator>
59
+ operator+(const basic_string<charT, traits, Allocator>& lhs, charT rhs);
60
+ template<class charT, class traits, class Allocator>
61
+ basic_string<charT, traits, Allocator>
62
+ operator+(basic_string<charT, traits, Allocator>&& lhs, charT rhs);
63
+
64
+ template<class charT, class traits, class Allocator>
65
+ bool operator==(const basic_string<charT, traits, Allocator>& lhs,
66
+ const basic_string<charT, traits, Allocator>& rhs) noexcept;
67
+ template<class charT, class traits, class Allocator>
68
+ bool operator==(const charT* lhs,
69
+ const basic_string<charT, traits, Allocator>& rhs);
70
+ template<class charT, class traits, class Allocator>
71
+ bool operator==(const basic_string<charT, traits, Allocator>& lhs,
72
+ const charT* rhs);
73
+ template<class charT, class traits, class Allocator>
74
+ bool operator!=(const basic_string<charT, traits, Allocator>& lhs,
75
+ const basic_string<charT, traits, Allocator>& rhs) noexcept;
76
+ template<class charT, class traits, class Allocator>
77
+ bool operator!=(const charT* lhs,
78
+ const basic_string<charT, traits, Allocator>& rhs);
79
+ template<class charT, class traits, class Allocator>
80
+ bool operator!=(const basic_string<charT, traits, Allocator>& lhs,
81
+ const charT* rhs);
82
+
83
+ template<class charT, class traits, class Allocator>
84
+ bool operator< (const basic_string<charT, traits, Allocator>& lhs,
85
+ const basic_string<charT, traits, Allocator>& rhs) noexcept;
86
+ template<class charT, class traits, class Allocator>
87
+ bool operator< (const basic_string<charT, traits, Allocator>& lhs,
88
+ const charT* rhs);
89
+ template<class charT, class traits, class Allocator>
90
+ bool operator< (const charT* lhs,
91
+ const basic_string<charT, traits, Allocator>& rhs);
92
+ template<class charT, class traits, class Allocator>
93
+ bool operator> (const basic_string<charT, traits, Allocator>& lhs,
94
+ const basic_string<charT, traits, Allocator>& rhs) noexcept;
95
+ template<class charT, class traits, class Allocator>
96
+ bool operator> (const basic_string<charT, traits, Allocator>& lhs,
97
+ const charT* rhs);
98
+ template<class charT, class traits, class Allocator>
99
+ bool operator> (const charT* lhs,
100
+ const basic_string<charT, traits, Allocator>& rhs);
101
+
102
+ template<class charT, class traits, class Allocator>
103
+ bool operator<=(const basic_string<charT, traits, Allocator>& lhs,
104
+ const basic_string<charT, traits, Allocator>& rhs) noexcept;
105
+ template<class charT, class traits, class Allocator>
106
+ bool operator<=(const basic_string<charT, traits, Allocator>& lhs,
107
+ const charT* rhs);
108
+ template<class charT, class traits, class Allocator>
109
+ bool operator<=(const charT* lhs,
110
+ const basic_string<charT, traits, Allocator>& rhs);
111
+ template<class charT, class traits, class Allocator>
112
+ bool operator>=(const basic_string<charT, traits, Allocator>& lhs,
113
+ const basic_string<charT, traits, Allocator>& rhs) noexcept;
114
+ template<class charT, class traits, class Allocator>
115
+ bool operator>=(const basic_string<charT, traits, Allocator>& lhs,
116
+ const charT* rhs);
117
+ template<class charT, class traits, class Allocator>
118
+ bool operator>=(const charT* lhs,
119
+ const basic_string<charT, traits, Allocator>& rhs);
120
+
121
+ // [string.special], swap
122
+ template<class charT, class traits, class Allocator>
123
+ void swap(basic_string<charT, traits, Allocator>& lhs,
124
+ basic_string<charT, traits, Allocator>& rhs)
125
+ noexcept(noexcept(lhs.swap(rhs)));
126
+
127
+ // [string.io], inserters and extractors
128
+ template<class charT, class traits, class Allocator>
129
+ basic_istream<charT, traits>&
130
+ operator>>(basic_istream<charT, traits>& is,
131
+ basic_string<charT, traits, Allocator>& str);
132
+ template<class charT, class traits, class Allocator>
133
+ basic_ostream<charT, traits>&
134
+ operator<<(basic_ostream<charT, traits>& os,
135
+ const basic_string<charT, traits, Allocator>& str);
136
+ template<class charT, class traits, class Allocator>
137
+ basic_istream<charT, traits>&
138
+ getline(basic_istream<charT, traits>& is,
139
+ basic_string<charT, traits, Allocator>& str,
140
+ charT delim);
141
+ template<class charT, class traits, class Allocator>
142
+ basic_istream<charT, traits>&
143
+ getline(basic_istream<charT, traits>&& is,
144
+ basic_string<charT, traits, Allocator>& str,
145
+ charT delim);
146
+ template<class charT, class traits, class Allocator>
147
+ basic_istream<charT, traits>&
148
+ getline(basic_istream<charT, traits>& is,
149
+ basic_string<charT, traits, Allocator>& str);
150
+ template<class charT, class traits, class Allocator>
151
+ basic_istream<charT, traits>&
152
+ getline(basic_istream<charT, traits>&& is,
153
+ basic_string<charT, traits, Allocator>& str);
154
+
155
+ // basic_string typedef names
156
+ using string = basic_string<char>;
157
+ using u16string = basic_string<char16_t>;
158
+ using u32string = basic_string<char32_t>;
159
+ using wstring = basic_string<wchar_t>;
160
+
161
+ // [string.conversions], numeric conversions
162
+ int stoi(const string& str, size_t* idx = 0, int base = 10);
163
+ long stol(const string& str, size_t* idx = 0, int base = 10);
164
+ unsigned long stoul(const string& str, size_t* idx = 0, int base = 10);
165
+ long long stoll(const string& str, size_t* idx = 0, int base = 10);
166
+ unsigned long long stoull(const string& str, size_t* idx = 0, int base = 10);
167
+ float stof(const string& str, size_t* idx = 0);
168
+ double stod(const string& str, size_t* idx = 0);
169
+ long double stold(const string& str, size_t* idx = 0);
170
+ string to_string(int val);
171
+ string to_string(unsigned val);
172
+ string to_string(long val);
173
+ string to_string(unsigned long val);
174
+ string to_string(long long val);
175
+ string to_string(unsigned long long val);
176
+ string to_string(float val);
177
+ string to_string(double val);
178
+ string to_string(long double val);
179
+
180
+ int stoi(const wstring& str, size_t* idx = 0, int base = 10);
181
+ long stol(const wstring& str, size_t* idx = 0, int base = 10);
182
+ unsigned long stoul(const wstring& str, size_t* idx = 0, int base = 10);
183
+ long long stoll(const wstring& str, size_t* idx = 0, int base = 10);
184
+ unsigned long long stoull(const wstring& str, size_t* idx = 0, int base = 10);
185
+ float stof(const wstring& str, size_t* idx = 0);
186
+ double stod(const wstring& str, size_t* idx = 0);
187
+ long double stold(const wstring& str, size_t* idx = 0);
188
+ wstring to_wstring(int val);
189
+ wstring to_wstring(unsigned val);
190
+ wstring to_wstring(long val);
191
+ wstring to_wstring(unsigned long val);
192
+ wstring to_wstring(long long val);
193
+ wstring to_wstring(unsigned long long val);
194
+ wstring to_wstring(float val);
195
+ wstring to_wstring(double val);
196
+ wstring to_wstring(long double val);
197
+
198
+ // [basic.string.hash], hash support
199
+ template<class T> struct hash;
200
+ template<> struct hash<string>;
201
+ template<> struct hash<u16string>;
202
+ template<> struct hash<u32string>;
203
+ template<> struct hash<wstring>;
204
+
205
+ namespace pmr {
206
+ template <class charT, class traits = char_traits<charT>>
207
+ using basic_string =
208
+ std::basic_string<charT, traits, polymorphic_allocator<charT>>;
209
+
210
+ using string = basic_string<char>;
211
+ using u16string = basic_string<char16_t>;
212
+ using u32string = basic_string<char32_t>;
213
+ using wstring = basic_string<wchar_t>;
214
+ }
215
+
216
+ inline namespace literals {
217
+ inline namespace string_literals {
218
+ // [basic.string.literals], suffix for basic_string literals
219
+ string operator""s(const char* str, size_t len);
220
+ u16string operator""s(const char16_t* str, size_t len);
221
+ u32string operator""s(const char32_t* str, size_t len);
222
+ wstring operator""s(const wchar_t* str, size_t len);
223
+ }
224
+ }
225
+ }
226
+ ```
227
+