2 //===----------------------------------------------------------------------===//
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP_CODECVT
11 #define _LIBCPP_CODECVT
26 template <class Elem, unsigned long Maxcode = 0x10ffff,
27 codecvt_mode Mode = (codecvt_mode)0>
29 : public codecvt<Elem, char, mbstate_t>
31 explicit codecvt_utf8(size_t refs = 0);
35 template <class Elem, unsigned long Maxcode = 0x10ffff,
36 codecvt_mode Mode = (codecvt_mode)0>
38 : public codecvt<Elem, char, mbstate_t>
40 explicit codecvt_utf16(size_t refs = 0);
44 template <class Elem, unsigned long Maxcode = 0x10ffff,
45 codecvt_mode Mode = (codecvt_mode)0>
46 class codecvt_utf8_utf16
47 : public codecvt<Elem, char, mbstate_t>
49 explicit codecvt_utf8_utf16(size_t refs = 0);
50 ~codecvt_utf8_utf16();
57 #include <__assert> // all public C++ headers provide the assertion handler
62 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
63 # pragma GCC system_header
66 #if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
68 _LIBCPP_BEGIN_NAMESPACE_STD
70 enum _LIBCPP_DEPRECATED_IN_CXX17 codecvt_mode { consume_header = 4, generate_header = 2, little_endian = 1 };
74 template <class _Elem>
77 # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
79 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<wchar_t> : public codecvt<wchar_t, char, mbstate_t> {
80 unsigned long __maxcode_;
81 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
83 _LIBCPP_SUPPRESS_DEPRECATED_POP
86 typedef wchar_t intern_type;
87 typedef char extern_type;
88 typedef mbstate_t state_type;
90 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
91 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
92 : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
93 _LIBCPP_SUPPRESS_DEPRECATED_POP
96 result do_out(state_type& __st,
97 const intern_type* __frm,
98 const intern_type* __frm_end,
99 const intern_type*& __frm_nxt,
101 extern_type* __to_end,
102 extern_type*& __to_nxt) const override;
103 result do_in(state_type& __st,
104 const extern_type* __frm,
105 const extern_type* __frm_end,
106 const extern_type*& __frm_nxt,
108 intern_type* __to_end,
109 intern_type*& __to_nxt) const override;
110 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
111 int do_encoding() const _NOEXCEPT override;
112 bool do_always_noconv() const _NOEXCEPT override;
113 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
114 int do_max_length() const _NOEXCEPT override;
116 # endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
118 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
120 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<char16_t> : public codecvt<char16_t, char, mbstate_t> {
121 unsigned long __maxcode_;
122 codecvt_mode __mode_;
125 typedef char16_t intern_type;
126 typedef char extern_type;
127 typedef mbstate_t state_type;
129 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
130 : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
131 _LIBCPP_SUPPRESS_DEPRECATED_POP
134 result do_out(state_type& __st,
135 const intern_type* __frm,
136 const intern_type* __frm_end,
137 const intern_type*& __frm_nxt,
139 extern_type* __to_end,
140 extern_type*& __to_nxt) const override;
141 result do_in(state_type& __st,
142 const extern_type* __frm,
143 const extern_type* __frm_end,
144 const extern_type*& __frm_nxt,
146 intern_type* __to_end,
147 intern_type*& __to_nxt) const override;
148 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
149 int do_encoding() const _NOEXCEPT override;
150 bool do_always_noconv() const _NOEXCEPT override;
151 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
152 int do_max_length() const _NOEXCEPT override;
155 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
157 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<char32_t> : public codecvt<char32_t, char, mbstate_t> {
158 unsigned long __maxcode_;
159 codecvt_mode __mode_;
162 typedef char32_t intern_type;
163 typedef char extern_type;
164 typedef mbstate_t state_type;
166 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
167 : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
168 _LIBCPP_SUPPRESS_DEPRECATED_POP
171 result do_out(state_type& __st,
172 const intern_type* __frm,
173 const intern_type* __frm_end,
174 const intern_type*& __frm_nxt,
176 extern_type* __to_end,
177 extern_type*& __to_nxt) const override;
178 result do_in(state_type& __st,
179 const extern_type* __frm,
180 const extern_type* __frm_end,
181 const extern_type*& __frm_nxt,
183 intern_type* __to_end,
184 intern_type*& __to_nxt) const override;
185 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
186 int do_encoding() const _NOEXCEPT override;
187 bool do_always_noconv() const _NOEXCEPT override;
188 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
189 int do_max_length() const _NOEXCEPT override;
192 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
193 template <class _Elem, unsigned long _Maxcode = 0x10ffff, codecvt_mode _Mode = (codecvt_mode)0>
194 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
196 _LIBCPP_HIDE_FROM_ABI explicit codecvt_utf8(size_t __refs = 0) : __codecvt_utf8<_Elem>(__refs, _Maxcode, _Mode) {}
198 _LIBCPP_HIDE_FROM_ABI ~codecvt_utf8() {}
200 _LIBCPP_SUPPRESS_DEPRECATED_POP
204 template <class _Elem, bool _LittleEndian>
205 class __codecvt_utf16;
207 # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
209 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<wchar_t, false> : public codecvt<wchar_t, char, mbstate_t> {
210 unsigned long __maxcode_;
211 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
212 codecvt_mode __mode_;
213 _LIBCPP_SUPPRESS_DEPRECATED_POP
216 typedef wchar_t intern_type;
217 typedef char extern_type;
218 typedef mbstate_t state_type;
220 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
221 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
222 : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
223 _LIBCPP_SUPPRESS_DEPRECATED_POP
226 result do_out(state_type& __st,
227 const intern_type* __frm,
228 const intern_type* __frm_end,
229 const intern_type*& __frm_nxt,
231 extern_type* __to_end,
232 extern_type*& __to_nxt) const override;
233 result do_in(state_type& __st,
234 const extern_type* __frm,
235 const extern_type* __frm_end,
236 const extern_type*& __frm_nxt,
238 intern_type* __to_end,
239 intern_type*& __to_nxt) const override;
240 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
241 int do_encoding() const _NOEXCEPT override;
242 bool do_always_noconv() const _NOEXCEPT override;
243 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
244 int do_max_length() const _NOEXCEPT override;
248 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<wchar_t, true> : public codecvt<wchar_t, char, mbstate_t> {
249 unsigned long __maxcode_;
250 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
251 codecvt_mode __mode_;
252 _LIBCPP_SUPPRESS_DEPRECATED_POP
255 typedef wchar_t intern_type;
256 typedef char extern_type;
257 typedef mbstate_t state_type;
259 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
260 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
261 : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
262 _LIBCPP_SUPPRESS_DEPRECATED_POP
265 result do_out(state_type& __st,
266 const intern_type* __frm,
267 const intern_type* __frm_end,
268 const intern_type*& __frm_nxt,
270 extern_type* __to_end,
271 extern_type*& __to_nxt) const override;
272 result do_in(state_type& __st,
273 const extern_type* __frm,
274 const extern_type* __frm_end,
275 const extern_type*& __frm_nxt,
277 intern_type* __to_end,
278 intern_type*& __to_nxt) const override;
279 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
280 int do_encoding() const _NOEXCEPT override;
281 bool do_always_noconv() const _NOEXCEPT override;
282 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
283 int do_max_length() const _NOEXCEPT override;
285 # endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
287 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
289 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char16_t, false> : public codecvt<char16_t, char, mbstate_t> {
290 unsigned long __maxcode_;
291 codecvt_mode __mode_;
294 typedef char16_t intern_type;
295 typedef char extern_type;
296 typedef mbstate_t state_type;
298 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
299 : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
300 _LIBCPP_SUPPRESS_DEPRECATED_POP
303 result do_out(state_type& __st,
304 const intern_type* __frm,
305 const intern_type* __frm_end,
306 const intern_type*& __frm_nxt,
308 extern_type* __to_end,
309 extern_type*& __to_nxt) const override;
310 result do_in(state_type& __st,
311 const extern_type* __frm,
312 const extern_type* __frm_end,
313 const extern_type*& __frm_nxt,
315 intern_type* __to_end,
316 intern_type*& __to_nxt) const override;
317 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
318 int do_encoding() const _NOEXCEPT override;
319 bool do_always_noconv() const _NOEXCEPT override;
320 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
321 int do_max_length() const _NOEXCEPT override;
324 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
326 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char16_t, true> : public codecvt<char16_t, char, mbstate_t> {
327 unsigned long __maxcode_;
328 codecvt_mode __mode_;
331 typedef char16_t intern_type;
332 typedef char extern_type;
333 typedef mbstate_t state_type;
335 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
336 : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
337 _LIBCPP_SUPPRESS_DEPRECATED_POP
340 result do_out(state_type& __st,
341 const intern_type* __frm,
342 const intern_type* __frm_end,
343 const intern_type*& __frm_nxt,
345 extern_type* __to_end,
346 extern_type*& __to_nxt) const override;
347 result do_in(state_type& __st,
348 const extern_type* __frm,
349 const extern_type* __frm_end,
350 const extern_type*& __frm_nxt,
352 intern_type* __to_end,
353 intern_type*& __to_nxt) const override;
354 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
355 int do_encoding() const _NOEXCEPT override;
356 bool do_always_noconv() const _NOEXCEPT override;
357 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
358 int do_max_length() const _NOEXCEPT override;
361 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
363 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char32_t, false> : public codecvt<char32_t, char, mbstate_t> {
364 unsigned long __maxcode_;
365 codecvt_mode __mode_;
368 typedef char32_t intern_type;
369 typedef char extern_type;
370 typedef mbstate_t state_type;
372 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
373 : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
374 _LIBCPP_SUPPRESS_DEPRECATED_POP
377 result do_out(state_type& __st,
378 const intern_type* __frm,
379 const intern_type* __frm_end,
380 const intern_type*& __frm_nxt,
382 extern_type* __to_end,
383 extern_type*& __to_nxt) const override;
384 result do_in(state_type& __st,
385 const extern_type* __frm,
386 const extern_type* __frm_end,
387 const extern_type*& __frm_nxt,
389 intern_type* __to_end,
390 intern_type*& __to_nxt) const override;
391 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
392 int do_encoding() const _NOEXCEPT override;
393 bool do_always_noconv() const _NOEXCEPT override;
394 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
395 int do_max_length() const _NOEXCEPT override;
398 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
400 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char32_t, true> : public codecvt<char32_t, char, mbstate_t> {
401 unsigned long __maxcode_;
402 codecvt_mode __mode_;
405 typedef char32_t intern_type;
406 typedef char extern_type;
407 typedef mbstate_t state_type;
409 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
410 : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
411 _LIBCPP_SUPPRESS_DEPRECATED_POP
414 result do_out(state_type& __st,
415 const intern_type* __frm,
416 const intern_type* __frm_end,
417 const intern_type*& __frm_nxt,
419 extern_type* __to_end,
420 extern_type*& __to_nxt) const override;
421 result do_in(state_type& __st,
422 const extern_type* __frm,
423 const extern_type* __frm_end,
424 const extern_type*& __frm_nxt,
426 intern_type* __to_end,
427 intern_type*& __to_nxt) const override;
428 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
429 int do_encoding() const _NOEXCEPT override;
430 bool do_always_noconv() const _NOEXCEPT override;
431 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
432 int do_max_length() const _NOEXCEPT override;
435 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
436 template <class _Elem, unsigned long _Maxcode = 0x10ffff, codecvt_mode _Mode = (codecvt_mode)0>
437 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf16
438 : public __codecvt_utf16<_Elem, _Mode & little_endian> {
440 _LIBCPP_HIDE_FROM_ABI explicit codecvt_utf16(size_t __refs = 0)
441 : __codecvt_utf16<_Elem, _Mode & little_endian>(__refs, _Maxcode, _Mode) {}
443 _LIBCPP_HIDE_FROM_ABI ~codecvt_utf16() {}
445 _LIBCPP_SUPPRESS_DEPRECATED_POP
447 // codecvt_utf8_utf16
449 template <class _Elem>
450 class __codecvt_utf8_utf16;
452 # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
454 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<wchar_t> : public codecvt<wchar_t, char, mbstate_t> {
455 unsigned long __maxcode_;
456 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
457 codecvt_mode __mode_;
458 _LIBCPP_SUPPRESS_DEPRECATED_POP
461 typedef wchar_t intern_type;
462 typedef char extern_type;
463 typedef mbstate_t state_type;
465 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
466 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
467 : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
468 _LIBCPP_SUPPRESS_DEPRECATED_POP
471 result do_out(state_type& __st,
472 const intern_type* __frm,
473 const intern_type* __frm_end,
474 const intern_type*& __frm_nxt,
476 extern_type* __to_end,
477 extern_type*& __to_nxt) const override;
478 result do_in(state_type& __st,
479 const extern_type* __frm,
480 const extern_type* __frm_end,
481 const extern_type*& __frm_nxt,
483 intern_type* __to_end,
484 intern_type*& __to_nxt) const override;
485 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
486 int do_encoding() const _NOEXCEPT override;
487 bool do_always_noconv() const _NOEXCEPT override;
488 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
489 int do_max_length() const _NOEXCEPT override;
491 # endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
493 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
495 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<char32_t> : public codecvt<char32_t, char, mbstate_t> {
496 unsigned long __maxcode_;
497 codecvt_mode __mode_;
500 typedef char32_t intern_type;
501 typedef char extern_type;
502 typedef mbstate_t state_type;
504 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
505 : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
506 _LIBCPP_SUPPRESS_DEPRECATED_POP
509 result do_out(state_type& __st,
510 const intern_type* __frm,
511 const intern_type* __frm_end,
512 const intern_type*& __frm_nxt,
514 extern_type* __to_end,
515 extern_type*& __to_nxt) const override;
516 result do_in(state_type& __st,
517 const extern_type* __frm,
518 const extern_type* __frm_end,
519 const extern_type*& __frm_nxt,
521 intern_type* __to_end,
522 intern_type*& __to_nxt) const override;
523 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
524 int do_encoding() const _NOEXCEPT override;
525 bool do_always_noconv() const _NOEXCEPT override;
526 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
527 int do_max_length() const _NOEXCEPT override;
530 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
532 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<char16_t> : public codecvt<char16_t, char, mbstate_t> {
533 unsigned long __maxcode_;
534 codecvt_mode __mode_;
537 typedef char16_t intern_type;
538 typedef char extern_type;
539 typedef mbstate_t state_type;
541 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
542 : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
543 _LIBCPP_SUPPRESS_DEPRECATED_POP
546 result do_out(state_type& __st,
547 const intern_type* __frm,
548 const intern_type* __frm_end,
549 const intern_type*& __frm_nxt,
551 extern_type* __to_end,
552 extern_type*& __to_nxt) const override;
553 result do_in(state_type& __st,
554 const extern_type* __frm,
555 const extern_type* __frm_end,
556 const extern_type*& __frm_nxt,
558 intern_type* __to_end,
559 intern_type*& __to_nxt) const override;
560 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
561 int do_encoding() const _NOEXCEPT override;
562 bool do_always_noconv() const _NOEXCEPT override;
563 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
564 int do_max_length() const _NOEXCEPT override;
567 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
568 template <class _Elem, unsigned long _Maxcode = 0x10ffff, codecvt_mode _Mode = (codecvt_mode)0>
569 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8_utf16 : public __codecvt_utf8_utf16<_Elem> {
571 _LIBCPP_HIDE_FROM_ABI explicit codecvt_utf8_utf16(size_t __refs = 0)
572 : __codecvt_utf8_utf16<_Elem>(__refs, _Maxcode, _Mode) {}
574 _LIBCPP_HIDE_FROM_ABI ~codecvt_utf8_utf16() {}
576 _LIBCPP_SUPPRESS_DEPRECATED_POP
578 _LIBCPP_END_NAMESPACE_STD
580 #endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
582 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
588 # include <initializer_list>
593 # include <stdexcept>
594 # include <type_traits>
598 #endif // _LIBCPP_CODECVT