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();
61 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
62 # pragma GCC system_header
65 #if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
67 _LIBCPP_BEGIN_NAMESPACE_STD
69 enum _LIBCPP_DEPRECATED_IN_CXX17 codecvt_mode { consume_header = 4, generate_header = 2, little_endian = 1 };
73 template <class _Elem>
76 # if _LIBCPP_HAS_WIDE_CHARACTERS
78 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<wchar_t> : public codecvt<wchar_t, char, mbstate_t> {
79 unsigned long __maxcode_;
80 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
82 _LIBCPP_SUPPRESS_DEPRECATED_POP
85 typedef wchar_t intern_type;
86 typedef char extern_type;
87 typedef mbstate_t state_type;
89 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
90 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
91 : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
92 _LIBCPP_SUPPRESS_DEPRECATED_POP
95 result do_out(state_type& __st,
96 const intern_type* __frm,
97 const intern_type* __frm_end,
98 const intern_type*& __frm_nxt,
100 extern_type* __to_end,
101 extern_type*& __to_nxt) const override;
102 result do_in(state_type& __st,
103 const extern_type* __frm,
104 const extern_type* __frm_end,
105 const extern_type*& __frm_nxt,
107 intern_type* __to_end,
108 intern_type*& __to_nxt) const override;
109 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
110 int do_encoding() const _NOEXCEPT override;
111 bool do_always_noconv() const _NOEXCEPT override;
112 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
113 int do_max_length() const _NOEXCEPT override;
115 # endif // _LIBCPP_HAS_WIDE_CHARACTERS
117 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
119 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<char16_t> : public codecvt<char16_t, char, mbstate_t> {
120 unsigned long __maxcode_;
121 codecvt_mode __mode_;
124 typedef char16_t intern_type;
125 typedef char extern_type;
126 typedef mbstate_t state_type;
128 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
129 : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
130 _LIBCPP_SUPPRESS_DEPRECATED_POP
133 result do_out(state_type& __st,
134 const intern_type* __frm,
135 const intern_type* __frm_end,
136 const intern_type*& __frm_nxt,
138 extern_type* __to_end,
139 extern_type*& __to_nxt) const override;
140 result do_in(state_type& __st,
141 const extern_type* __frm,
142 const extern_type* __frm_end,
143 const extern_type*& __frm_nxt,
145 intern_type* __to_end,
146 intern_type*& __to_nxt) const override;
147 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
148 int do_encoding() const _NOEXCEPT override;
149 bool do_always_noconv() const _NOEXCEPT override;
150 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
151 int do_max_length() const _NOEXCEPT override;
154 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
156 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<char32_t> : public codecvt<char32_t, char, mbstate_t> {
157 unsigned long __maxcode_;
158 codecvt_mode __mode_;
161 typedef char32_t intern_type;
162 typedef char extern_type;
163 typedef mbstate_t state_type;
165 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
166 : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
167 _LIBCPP_SUPPRESS_DEPRECATED_POP
170 result do_out(state_type& __st,
171 const intern_type* __frm,
172 const intern_type* __frm_end,
173 const intern_type*& __frm_nxt,
175 extern_type* __to_end,
176 extern_type*& __to_nxt) const override;
177 result do_in(state_type& __st,
178 const extern_type* __frm,
179 const extern_type* __frm_end,
180 const extern_type*& __frm_nxt,
182 intern_type* __to_end,
183 intern_type*& __to_nxt) const override;
184 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
185 int do_encoding() const _NOEXCEPT override;
186 bool do_always_noconv() const _NOEXCEPT override;
187 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
188 int do_max_length() const _NOEXCEPT override;
191 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
192 template <class _Elem, unsigned long _Maxcode = 0x10ffff, codecvt_mode _Mode = (codecvt_mode)0>
193 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
195 _LIBCPP_HIDE_FROM_ABI explicit codecvt_utf8(size_t __refs = 0) : __codecvt_utf8<_Elem>(__refs, _Maxcode, _Mode) {}
197 _LIBCPP_HIDE_FROM_ABI ~codecvt_utf8() {}
199 _LIBCPP_SUPPRESS_DEPRECATED_POP
203 template <class _Elem, bool _LittleEndian>
204 class __codecvt_utf16;
206 # if _LIBCPP_HAS_WIDE_CHARACTERS
208 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<wchar_t, false> : public codecvt<wchar_t, char, mbstate_t> {
209 unsigned long __maxcode_;
210 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
211 codecvt_mode __mode_;
212 _LIBCPP_SUPPRESS_DEPRECATED_POP
215 typedef wchar_t intern_type;
216 typedef char extern_type;
217 typedef mbstate_t state_type;
219 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
220 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
221 : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
222 _LIBCPP_SUPPRESS_DEPRECATED_POP
225 result do_out(state_type& __st,
226 const intern_type* __frm,
227 const intern_type* __frm_end,
228 const intern_type*& __frm_nxt,
230 extern_type* __to_end,
231 extern_type*& __to_nxt) const override;
232 result do_in(state_type& __st,
233 const extern_type* __frm,
234 const extern_type* __frm_end,
235 const extern_type*& __frm_nxt,
237 intern_type* __to_end,
238 intern_type*& __to_nxt) const override;
239 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
240 int do_encoding() const _NOEXCEPT override;
241 bool do_always_noconv() const _NOEXCEPT override;
242 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
243 int do_max_length() const _NOEXCEPT override;
247 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<wchar_t, true> : public codecvt<wchar_t, char, mbstate_t> {
248 unsigned long __maxcode_;
249 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
250 codecvt_mode __mode_;
251 _LIBCPP_SUPPRESS_DEPRECATED_POP
254 typedef wchar_t intern_type;
255 typedef char extern_type;
256 typedef mbstate_t state_type;
258 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
259 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
260 : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
261 _LIBCPP_SUPPRESS_DEPRECATED_POP
264 result do_out(state_type& __st,
265 const intern_type* __frm,
266 const intern_type* __frm_end,
267 const intern_type*& __frm_nxt,
269 extern_type* __to_end,
270 extern_type*& __to_nxt) const override;
271 result do_in(state_type& __st,
272 const extern_type* __frm,
273 const extern_type* __frm_end,
274 const extern_type*& __frm_nxt,
276 intern_type* __to_end,
277 intern_type*& __to_nxt) const override;
278 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
279 int do_encoding() const _NOEXCEPT override;
280 bool do_always_noconv() const _NOEXCEPT override;
281 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
282 int do_max_length() const _NOEXCEPT override;
284 # endif // _LIBCPP_HAS_WIDE_CHARACTERS
286 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
288 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char16_t, false> : public codecvt<char16_t, char, mbstate_t> {
289 unsigned long __maxcode_;
290 codecvt_mode __mode_;
293 typedef char16_t intern_type;
294 typedef char extern_type;
295 typedef mbstate_t state_type;
297 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
298 : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
299 _LIBCPP_SUPPRESS_DEPRECATED_POP
302 result do_out(state_type& __st,
303 const intern_type* __frm,
304 const intern_type* __frm_end,
305 const intern_type*& __frm_nxt,
307 extern_type* __to_end,
308 extern_type*& __to_nxt) const override;
309 result do_in(state_type& __st,
310 const extern_type* __frm,
311 const extern_type* __frm_end,
312 const extern_type*& __frm_nxt,
314 intern_type* __to_end,
315 intern_type*& __to_nxt) const override;
316 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
317 int do_encoding() const _NOEXCEPT override;
318 bool do_always_noconv() const _NOEXCEPT override;
319 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
320 int do_max_length() const _NOEXCEPT override;
323 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
325 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char16_t, true> : public codecvt<char16_t, char, mbstate_t> {
326 unsigned long __maxcode_;
327 codecvt_mode __mode_;
330 typedef char16_t intern_type;
331 typedef char extern_type;
332 typedef mbstate_t state_type;
334 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
335 : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
336 _LIBCPP_SUPPRESS_DEPRECATED_POP
339 result do_out(state_type& __st,
340 const intern_type* __frm,
341 const intern_type* __frm_end,
342 const intern_type*& __frm_nxt,
344 extern_type* __to_end,
345 extern_type*& __to_nxt) const override;
346 result do_in(state_type& __st,
347 const extern_type* __frm,
348 const extern_type* __frm_end,
349 const extern_type*& __frm_nxt,
351 intern_type* __to_end,
352 intern_type*& __to_nxt) const override;
353 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
354 int do_encoding() const _NOEXCEPT override;
355 bool do_always_noconv() const _NOEXCEPT override;
356 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
357 int do_max_length() const _NOEXCEPT override;
360 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
362 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char32_t, false> : public codecvt<char32_t, char, mbstate_t> {
363 unsigned long __maxcode_;
364 codecvt_mode __mode_;
367 typedef char32_t intern_type;
368 typedef char extern_type;
369 typedef mbstate_t state_type;
371 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
372 : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
373 _LIBCPP_SUPPRESS_DEPRECATED_POP
376 result do_out(state_type& __st,
377 const intern_type* __frm,
378 const intern_type* __frm_end,
379 const intern_type*& __frm_nxt,
381 extern_type* __to_end,
382 extern_type*& __to_nxt) const override;
383 result do_in(state_type& __st,
384 const extern_type* __frm,
385 const extern_type* __frm_end,
386 const extern_type*& __frm_nxt,
388 intern_type* __to_end,
389 intern_type*& __to_nxt) const override;
390 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
391 int do_encoding() const _NOEXCEPT override;
392 bool do_always_noconv() const _NOEXCEPT override;
393 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
394 int do_max_length() const _NOEXCEPT override;
397 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
399 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<char32_t, true> : public codecvt<char32_t, char, mbstate_t> {
400 unsigned long __maxcode_;
401 codecvt_mode __mode_;
404 typedef char32_t intern_type;
405 typedef char extern_type;
406 typedef mbstate_t state_type;
408 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
409 : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
410 _LIBCPP_SUPPRESS_DEPRECATED_POP
413 result do_out(state_type& __st,
414 const intern_type* __frm,
415 const intern_type* __frm_end,
416 const intern_type*& __frm_nxt,
418 extern_type* __to_end,
419 extern_type*& __to_nxt) const override;
420 result do_in(state_type& __st,
421 const extern_type* __frm,
422 const extern_type* __frm_end,
423 const extern_type*& __frm_nxt,
425 intern_type* __to_end,
426 intern_type*& __to_nxt) const override;
427 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
428 int do_encoding() const _NOEXCEPT override;
429 bool do_always_noconv() const _NOEXCEPT override;
430 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
431 int do_max_length() const _NOEXCEPT override;
434 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
435 template <class _Elem, unsigned long _Maxcode = 0x10ffff, codecvt_mode _Mode = (codecvt_mode)0>
436 class _LIBCPP_TEMPLATE_VIS
437 _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf16 : public __codecvt_utf16<_Elem, _Mode & little_endian> {
439 _LIBCPP_HIDE_FROM_ABI explicit codecvt_utf16(size_t __refs = 0)
440 : __codecvt_utf16<_Elem, _Mode & little_endian>(__refs, _Maxcode, _Mode) {}
442 _LIBCPP_HIDE_FROM_ABI ~codecvt_utf16() {}
444 _LIBCPP_SUPPRESS_DEPRECATED_POP
446 // codecvt_utf8_utf16
448 template <class _Elem>
449 class __codecvt_utf8_utf16;
451 # if _LIBCPP_HAS_WIDE_CHARACTERS
453 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<wchar_t> : public codecvt<wchar_t, char, mbstate_t> {
454 unsigned long __maxcode_;
455 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
456 codecvt_mode __mode_;
457 _LIBCPP_SUPPRESS_DEPRECATED_POP
460 typedef wchar_t intern_type;
461 typedef char extern_type;
462 typedef mbstate_t state_type;
464 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
465 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
466 : codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
467 _LIBCPP_SUPPRESS_DEPRECATED_POP
470 result do_out(state_type& __st,
471 const intern_type* __frm,
472 const intern_type* __frm_end,
473 const intern_type*& __frm_nxt,
475 extern_type* __to_end,
476 extern_type*& __to_nxt) const override;
477 result do_in(state_type& __st,
478 const extern_type* __frm,
479 const extern_type* __frm_end,
480 const extern_type*& __frm_nxt,
482 intern_type* __to_end,
483 intern_type*& __to_nxt) const override;
484 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
485 int do_encoding() const _NOEXCEPT override;
486 bool do_always_noconv() const _NOEXCEPT override;
487 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
488 int do_max_length() const _NOEXCEPT override;
490 # endif // _LIBCPP_HAS_WIDE_CHARACTERS
492 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
494 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<char32_t> : public codecvt<char32_t, char, mbstate_t> {
495 unsigned long __maxcode_;
496 codecvt_mode __mode_;
499 typedef char32_t intern_type;
500 typedef char extern_type;
501 typedef mbstate_t state_type;
503 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
504 : codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
505 _LIBCPP_SUPPRESS_DEPRECATED_POP
508 result do_out(state_type& __st,
509 const intern_type* __frm,
510 const intern_type* __frm_end,
511 const intern_type*& __frm_nxt,
513 extern_type* __to_end,
514 extern_type*& __to_nxt) const override;
515 result do_in(state_type& __st,
516 const extern_type* __frm,
517 const extern_type* __frm_end,
518 const extern_type*& __frm_nxt,
520 intern_type* __to_end,
521 intern_type*& __to_nxt) const override;
522 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
523 int do_encoding() const _NOEXCEPT override;
524 bool do_always_noconv() const _NOEXCEPT override;
525 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
526 int do_max_length() const _NOEXCEPT override;
529 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
531 class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<char16_t> : public codecvt<char16_t, char, mbstate_t> {
532 unsigned long __maxcode_;
533 codecvt_mode __mode_;
536 typedef char16_t intern_type;
537 typedef char extern_type;
538 typedef mbstate_t state_type;
540 _LIBCPP_HIDE_FROM_ABI explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode)
541 : codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode), __mode_(__mode) {}
542 _LIBCPP_SUPPRESS_DEPRECATED_POP
545 result do_out(state_type& __st,
546 const intern_type* __frm,
547 const intern_type* __frm_end,
548 const intern_type*& __frm_nxt,
550 extern_type* __to_end,
551 extern_type*& __to_nxt) const override;
552 result do_in(state_type& __st,
553 const extern_type* __frm,
554 const extern_type* __frm_end,
555 const extern_type*& __frm_nxt,
557 intern_type* __to_end,
558 intern_type*& __to_nxt) const override;
559 result do_unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const override;
560 int do_encoding() const _NOEXCEPT override;
561 bool do_always_noconv() const _NOEXCEPT override;
562 int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
563 int do_max_length() const _NOEXCEPT override;
566 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
567 template <class _Elem, unsigned long _Maxcode = 0x10ffff, codecvt_mode _Mode = (codecvt_mode)0>
568 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8_utf16 : public __codecvt_utf8_utf16<_Elem> {
570 _LIBCPP_HIDE_FROM_ABI explicit codecvt_utf8_utf16(size_t __refs = 0)
571 : __codecvt_utf8_utf16<_Elem>(__refs, _Maxcode, _Mode) {}
573 _LIBCPP_HIDE_FROM_ABI ~codecvt_utf8_utf16() {}
575 _LIBCPP_SUPPRESS_DEPRECATED_POP
577 _LIBCPP_END_NAMESPACE_STD
579 #endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
581 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
587 # include <initializer_list>
592 # include <stdexcept>
593 # include <type_traits>
597 #endif // _LIBCPP_CODECVT