35#define _CHAR_TRAITS_H 1
37#pragma GCC system_header
45#ifdef _GLIBCXX_USE_WCHAR_T
49#if __cplusplus >= 201103L
51#if !defined __UINT_LEAST16_TYPE__ || !defined __UINT_LEAST32_TYPE__
55#if __cplusplus >= 202002L
60#ifndef _GLIBCXX_ALWAYS_INLINE
61# define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
64namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
66_GLIBCXX_BEGIN_NAMESPACE_VERSION
68#pragma GCC diagnostic push
69#pragma GCC diagnostic ignored "-Wstringop-overflow"
70#pragma GCC diagnostic ignored "-Wstringop-overread"
71#pragma GCC diagnostic ignored "-Warray-bounds"
83 template<
typename _CharT>
86 typedef unsigned long int_type;
90 typedef std::mbstate_t state_type;
110 template<
typename _CharT>
113 typedef _CharT char_type;
114 typedef typename _Char_types<_CharT>::int_type int_type;
117 typedef typename _Char_types<_CharT>::off_type off_type;
118 typedef typename _Char_types<_CharT>::state_type state_type;
120#if __cpp_lib_three_way_comparison
121 using comparison_category = std::strong_ordering;
124 static _GLIBCXX14_CONSTEXPR
void
125 assign(char_type& __c1,
const char_type& __c2)
127#if __cpp_constexpr_dynamic_alloc
128 if (std::__is_constant_evaluated())
129 std::construct_at(__builtin_addressof(__c1), __c2);
135 static _GLIBCXX_CONSTEXPR
bool
136 eq(
const char_type& __c1,
const char_type& __c2)
137 {
return __c1 == __c2; }
139 static _GLIBCXX_CONSTEXPR
bool
140 lt(
const char_type& __c1,
const char_type& __c2)
141 {
return __c1 < __c2; }
143 static _GLIBCXX14_CONSTEXPR
int
144 compare(
const char_type* __s1,
const char_type* __s2, std::size_t __n);
146 static _GLIBCXX14_CONSTEXPR std::size_t
147 length(
const char_type* __s);
149 static _GLIBCXX14_CONSTEXPR
const char_type*
150 find(
const char_type* __s, std::size_t __n,
const char_type& __a);
152 static _GLIBCXX20_CONSTEXPR char_type*
153 move(char_type* __s1,
const char_type* __s2, std::size_t __n);
155 static _GLIBCXX20_CONSTEXPR char_type*
156 copy(char_type* __s1,
const char_type* __s2, std::size_t __n);
158 static _GLIBCXX20_CONSTEXPR char_type*
159 assign(char_type* __s, std::size_t __n, char_type __a);
161 static _GLIBCXX_CONSTEXPR char_type
162 to_char_type(
const int_type& __c)
163 {
return static_cast<char_type
>(__c); }
165 static _GLIBCXX_CONSTEXPR int_type
166 to_int_type(
const char_type& __c)
167 {
return static_cast<int_type
>(__c); }
169 static _GLIBCXX_CONSTEXPR
bool
170 eq_int_type(
const int_type& __c1,
const int_type& __c2)
171 {
return __c1 == __c2; }
173#ifdef _GLIBCXX_STDIO_EOF
174 static _GLIBCXX_CONSTEXPR int_type
176 {
return static_cast<int_type
>(_GLIBCXX_STDIO_EOF); }
178 static _GLIBCXX_CONSTEXPR int_type
179 not_eof(
const int_type& __c)
180 {
return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
184 template<
typename _CharT>
185 _GLIBCXX14_CONSTEXPR
int
187 compare(
const char_type* __s1,
const char_type* __s2, std::size_t __n)
189 for (std::size_t __i = 0; __i < __n; ++__i)
190 if (lt(__s1[__i], __s2[__i]))
192 else if (lt(__s2[__i], __s1[__i]))
197 template<
typename _CharT>
198 _GLIBCXX14_CONSTEXPR std::size_t
199 char_traits<_CharT>::
200 length(
const char_type* __p)
203 while (!eq(__p[__i], char_type()))
208 template<
typename _CharT>
209 _GLIBCXX14_CONSTEXPR
const typename char_traits<_CharT>::char_type*
210 char_traits<_CharT>::
211 find(
const char_type* __s, std::size_t __n,
const char_type& __a)
213 for (std::size_t __i = 0; __i < __n; ++__i)
214 if (eq(__s[__i], __a))
219 template<
typename _CharT>
221 typename char_traits<_CharT>::char_type*
222 char_traits<_CharT>::
223 move(char_type* __s1,
const char_type* __s2, std::size_t __n)
227#if __cplusplus >= 202002L
228 if (std::__is_constant_evaluated())
232 const auto __end = __s2 + __n - 1;
233 bool __overlap =
false;
234 for (std::size_t __i = 0; __i < __n - 1; ++__i)
236 if (__s1 + __i == __end)
247 assign(__s1[__n], __s2[__n]);
252 copy(__s1, __s2, __n);
256 __builtin_memmove(__s1, __s2, __n *
sizeof(char_type));
260 template<
typename _CharT>
262 typename char_traits<_CharT>::char_type*
263 char_traits<_CharT>::
264 copy(char_type* __s1,
const char_type* __s2, std::size_t __n)
268#if __cplusplus >= 202002L
269 if (std::__is_constant_evaluated())
271 for (std::size_t __i = 0; __i < __n; ++__i)
272 std::construct_at(__s1 + __i, __s2[__i]);
276 __builtin_memcpy(__s1, __s2, __n *
sizeof(char_type));
280 template<
typename _CharT>
282 typename char_traits<_CharT>::char_type*
283 char_traits<_CharT>::
284 assign(char_type* __s, std::size_t __n, char_type __a)
286#if __cplusplus >= 202002L
287 if (std::__is_constant_evaluated())
289 for (std::size_t __i = 0; __i < __n; ++__i)
290 std::construct_at(__s + __i, __a);
295 if _GLIBCXX17_CONSTEXPR (
sizeof(_CharT) == 1 && __is_trivial(_CharT))
300 __builtin_memcpy(&__c, __builtin_addressof(__a), 1);
301 __builtin_memset(__s, __c, __n);
306 for (std::size_t __i = 0; __i < __n; ++__i)
312_GLIBCXX_END_NAMESPACE_VERSION
315namespace std _GLIBCXX_VISIBILITY(default)
317_GLIBCXX_BEGIN_NAMESPACE_VERSION
319#ifdef __cpp_lib_is_constant_evaluated
321# define __cpp_lib_constexpr_char_traits 201811L
322#elif __cplusplus >= 201703L && _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
324# define __cpp_lib_constexpr_char_traits 201611L
340 template<
typename _CharT>
349 typedef char char_type;
350 typedef int int_type;
354 typedef mbstate_t state_type;
356#if __cpp_lib_three_way_comparison
357 using comparison_category = strong_ordering;
360 static _GLIBCXX17_CONSTEXPR
void
361 assign(char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
363#if __cpp_constexpr_dynamic_alloc
364 if (std::__is_constant_evaluated())
365 std::construct_at(__builtin_addressof(__c1), __c2);
371 static _GLIBCXX_CONSTEXPR
bool
372 eq(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
373 {
return __c1 == __c2; }
375 static _GLIBCXX_CONSTEXPR
bool
376 lt(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
379 return (
static_cast<unsigned char>(__c1)
380 <
static_cast<unsigned char>(__c2));
383 static _GLIBCXX17_CONSTEXPR
int
384 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
388#if __cplusplus >= 201703L
389 if (std::__is_constant_evaluated())
391 for (
size_t __i = 0; __i < __n; ++__i)
392 if (lt(__s1[__i], __s2[__i]))
394 else if (lt(__s2[__i], __s1[__i]))
399 return __builtin_memcmp(__s1, __s2, __n);
402 static _GLIBCXX17_CONSTEXPR
size_t
403 length(
const char_type* __s)
405#if __cplusplus >= 201703L
406 if (std::__is_constant_evaluated())
409 return __builtin_strlen(__s);
412 static _GLIBCXX17_CONSTEXPR
const char_type*
413 find(
const char_type* __s,
size_t __n,
const char_type& __a)
417#if __cplusplus >= 201703L
418 if (std::__is_constant_evaluated())
421 return static_cast<const char_type*
>(__builtin_memchr(__s, __a, __n));
424 static _GLIBCXX20_CONSTEXPR char_type*
425 move(char_type* __s1,
const char_type* __s2,
size_t __n)
429#if __cplusplus >= 202002L
430 if (std::__is_constant_evaluated())
433 return static_cast<char_type*
>(__builtin_memmove(__s1, __s2, __n));
436 static _GLIBCXX20_CONSTEXPR char_type*
437 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
441#if __cplusplus >= 202002L
442 if (std::__is_constant_evaluated())
445 return static_cast<char_type*
>(__builtin_memcpy(__s1, __s2, __n));
448 static _GLIBCXX20_CONSTEXPR char_type*
449 assign(char_type* __s,
size_t __n, char_type __a)
453#if __cplusplus >= 202002L
454 if (std::__is_constant_evaluated())
457 return static_cast<char_type*
>(__builtin_memset(__s, __a, __n));
460 static _GLIBCXX_CONSTEXPR char_type
461 to_char_type(
const int_type& __c) _GLIBCXX_NOEXCEPT
462 {
return static_cast<char_type
>(__c); }
466 static _GLIBCXX_CONSTEXPR int_type
467 to_int_type(
const char_type& __c) _GLIBCXX_NOEXCEPT
468 {
return static_cast<int_type
>(
static_cast<unsigned char>(__c)); }
470 static _GLIBCXX_CONSTEXPR
bool
471 eq_int_type(
const int_type& __c1,
const int_type& __c2) _GLIBCXX_NOEXCEPT
472 {
return __c1 == __c2; }
474#ifdef _GLIBCXX_STDIO_EOF
475 static _GLIBCXX_CONSTEXPR int_type
476 eof() _GLIBCXX_NOEXCEPT
477 {
return static_cast<int_type
>(_GLIBCXX_STDIO_EOF); }
479 static _GLIBCXX_CONSTEXPR int_type
480 not_eof(
const int_type& __c) _GLIBCXX_NOEXCEPT
481 {
return (__c == eof()) ? 0 : __c; }
486#ifdef _GLIBCXX_USE_WCHAR_T
491 typedef wchar_t char_type;
492 typedef wint_t int_type;
496 typedef mbstate_t state_type;
498#if __cpp_lib_three_way_comparison
499 using comparison_category = strong_ordering;
502 static _GLIBCXX17_CONSTEXPR
void
503 assign(char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
505#if __cpp_constexpr_dynamic_alloc
506 if (std::__is_constant_evaluated())
507 std::construct_at(__builtin_addressof(__c1), __c2);
513 static _GLIBCXX_CONSTEXPR
bool
514 eq(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
515 {
return __c1 == __c2; }
517 static _GLIBCXX_CONSTEXPR
bool
518 lt(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
519 {
return __c1 < __c2; }
521 static _GLIBCXX17_CONSTEXPR
int
522 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
526#if __cplusplus >= 201703L
527 if (std::__is_constant_evaluated())
530 return wmemcmp(__s1, __s2, __n);
533 static _GLIBCXX17_CONSTEXPR
size_t
534 length(
const char_type* __s)
536#if __cplusplus >= 201703L
537 if (std::__is_constant_evaluated())
543 static _GLIBCXX17_CONSTEXPR
const char_type*
544 find(
const char_type* __s,
size_t __n,
const char_type& __a)
548#if __cplusplus >= 201703L
549 if (std::__is_constant_evaluated())
552 return wmemchr(__s, __a, __n);
555 static _GLIBCXX20_CONSTEXPR char_type*
556 move(char_type* __s1,
const char_type* __s2,
size_t __n)
560#if __cplusplus >= 202002L
561 if (std::__is_constant_evaluated())
564 return wmemmove(__s1, __s2, __n);
567 static _GLIBCXX20_CONSTEXPR char_type*
568 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
572#if __cplusplus >= 202002L
573 if (std::__is_constant_evaluated())
576 return wmemcpy(__s1, __s2, __n);
579 static _GLIBCXX20_CONSTEXPR char_type*
580 assign(char_type* __s,
size_t __n, char_type __a)
584#if __cplusplus >= 202002L
585 if (std::__is_constant_evaluated())
588 return wmemset(__s, __a, __n);
591 static _GLIBCXX_CONSTEXPR char_type
592 to_char_type(
const int_type& __c) _GLIBCXX_NOEXCEPT
593 {
return char_type(__c); }
595 static _GLIBCXX_CONSTEXPR int_type
596 to_int_type(
const char_type& __c) _GLIBCXX_NOEXCEPT
597 {
return int_type(__c); }
599 static _GLIBCXX_CONSTEXPR
bool
600 eq_int_type(
const int_type& __c1,
const int_type& __c2) _GLIBCXX_NOEXCEPT
601 {
return __c1 == __c2; }
604 static _GLIBCXX_CONSTEXPR int_type
605 eof() _GLIBCXX_NOEXCEPT
606 {
return static_cast<int_type
>(WEOF); }
608 static _GLIBCXX_CONSTEXPR int_type
609 not_eof(
const int_type& __c) _GLIBCXX_NOEXCEPT
610 {
return eq_int_type(__c, eof()) ? 0 : __c; }
619#ifdef _GLIBCXX_USE_CHAR8_T
621 struct char_traits<char8_t>
623 typedef char8_t char_type;
624 typedef unsigned int int_type;
626 typedef u8streampos pos_type;
628 typedef mbstate_t state_type;
630#if __cpp_lib_three_way_comparison
631 using comparison_category = strong_ordering;
634 static _GLIBCXX17_CONSTEXPR
void
635 assign(char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
637#if __cpp_constexpr_dynamic_alloc
638 if (std::__is_constant_evaluated())
639 std::construct_at(__builtin_addressof(__c1), __c2);
645 static _GLIBCXX_CONSTEXPR
bool
646 eq(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
647 {
return __c1 == __c2; }
649 static _GLIBCXX_CONSTEXPR
bool
650 lt(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
651 {
return __c1 < __c2; }
653 static _GLIBCXX17_CONSTEXPR
int
654 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
658#if __cplusplus >= 201703L
659 if (std::__is_constant_evaluated())
662 return __builtin_memcmp(__s1, __s2, __n);
665 static _GLIBCXX17_CONSTEXPR
size_t
666 length(
const char_type* __s)
668#if __cplusplus >= 201703L
669 if (std::__is_constant_evaluated())
673 while (!eq(__s[__i], char_type()))
678 static _GLIBCXX17_CONSTEXPR
const char_type*
679 find(
const char_type* __s,
size_t __n,
const char_type& __a)
683#if __cplusplus >= 201703L
684 if (std::__is_constant_evaluated())
687 return static_cast<const char_type*
>(__builtin_memchr(__s, __a, __n));
690 static _GLIBCXX20_CONSTEXPR char_type*
691 move(char_type* __s1,
const char_type* __s2,
size_t __n)
695#if __cplusplus >= 202002L
696 if (std::__is_constant_evaluated())
699 return static_cast<char_type*
>(__builtin_memmove(__s1, __s2, __n));
702 static _GLIBCXX20_CONSTEXPR char_type*
703 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
707#if __cplusplus >= 202002L
708 if (std::__is_constant_evaluated())
711 return static_cast<char_type*
>(__builtin_memcpy(__s1, __s2, __n));
714 static _GLIBCXX20_CONSTEXPR char_type*
715 assign(char_type* __s,
size_t __n, char_type __a)
719#if __cplusplus >= 202002L
720 if (std::__is_constant_evaluated())
723 return static_cast<char_type*
>(__builtin_memset(__s, __a, __n));
726 static _GLIBCXX_CONSTEXPR char_type
727 to_char_type(
const int_type& __c) _GLIBCXX_NOEXCEPT
728 {
return char_type(__c); }
730 static _GLIBCXX_CONSTEXPR int_type
731 to_int_type(
const char_type& __c) _GLIBCXX_NOEXCEPT
732 {
return int_type(__c); }
734 static _GLIBCXX_CONSTEXPR
bool
735 eq_int_type(
const int_type& __c1,
const int_type& __c2) _GLIBCXX_NOEXCEPT
736 {
return __c1 == __c2; }
739 static _GLIBCXX_CONSTEXPR int_type
740 eof() _GLIBCXX_NOEXCEPT
741 {
return static_cast<int_type
>(-1); }
743 static _GLIBCXX_CONSTEXPR int_type
744 not_eof(
const int_type& __c) _GLIBCXX_NOEXCEPT
745 {
return eq_int_type(__c, eof()) ? 0 : __c; }
750_GLIBCXX_END_NAMESPACE_VERSION
753#if __cplusplus >= 201103L
755namespace std _GLIBCXX_VISIBILITY(default)
757_GLIBCXX_BEGIN_NAMESPACE_VERSION
760 struct char_traits<char16_t>
762 typedef char16_t char_type;
763#ifdef __UINT_LEAST16_TYPE__
764 typedef __UINT_LEAST16_TYPE__ int_type;
765#elif defined _GLIBCXX_USE_C99_STDINT_TR1
766 typedef uint_least16_t int_type;
768 typedef make_unsigned<char16_t>::type int_type;
773 typedef mbstate_t state_type;
775#if __cpp_lib_three_way_comparison
776 using comparison_category = strong_ordering;
779 static _GLIBCXX17_CONSTEXPR
void
780 assign(char_type& __c1,
const char_type& __c2)
noexcept
782#if __cpp_constexpr_dynamic_alloc
783 if (std::__is_constant_evaluated())
784 std::construct_at(__builtin_addressof(__c1), __c2);
790 static constexpr bool
791 eq(
const char_type& __c1,
const char_type& __c2)
noexcept
792 {
return __c1 == __c2; }
794 static constexpr bool
795 lt(
const char_type& __c1,
const char_type& __c2)
noexcept
796 {
return __c1 < __c2; }
798 static _GLIBCXX17_CONSTEXPR
int
799 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
801 for (
size_t __i = 0; __i < __n; ++__i)
802 if (lt(__s1[__i], __s2[__i]))
804 else if (lt(__s2[__i], __s1[__i]))
809 static _GLIBCXX17_CONSTEXPR
size_t
810 length(
const char_type* __s)
813 while (!eq(__s[__i], char_type()))
818 static _GLIBCXX17_CONSTEXPR
const char_type*
819 find(
const char_type* __s,
size_t __n,
const char_type& __a)
821 for (
size_t __i = 0; __i < __n; ++__i)
822 if (eq(__s[__i], __a))
827 static _GLIBCXX20_CONSTEXPR char_type*
828 move(char_type* __s1,
const char_type* __s2,
size_t __n)
832#if __cplusplus >= 202002L
833 if (std::__is_constant_evaluated())
836 return (
static_cast<char_type*
>
837 (__builtin_memmove(__s1, __s2, __n *
sizeof(char_type))));
840 static _GLIBCXX20_CONSTEXPR char_type*
841 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
845#if __cplusplus >= 202002L
846 if (std::__is_constant_evaluated())
849 return (
static_cast<char_type*
>
850 (__builtin_memcpy(__s1, __s2, __n *
sizeof(char_type))));
853 static _GLIBCXX20_CONSTEXPR char_type*
854 assign(char_type* __s,
size_t __n, char_type __a)
856 for (
size_t __i = 0; __i < __n; ++__i)
857 assign(__s[__i], __a);
861 static constexpr char_type
862 to_char_type(
const int_type& __c)
noexcept
863 {
return char_type(__c); }
865 static constexpr bool
866 eq_int_type(
const int_type& __c1,
const int_type& __c2)
noexcept
867 {
return __c1 == __c2; }
870 static constexpr int_type
871 to_int_type(
const char_type& __c)
noexcept
872 {
return __c == eof() ? int_type(0xfffd) : int_type(__c); }
874 static constexpr int_type
876 {
return static_cast<int_type
>(-1); }
878 static constexpr int_type
879 not_eof(
const int_type& __c)
noexcept
880 {
return eq_int_type(__c, eof()) ? 0 : __c; }
882 static constexpr int_type
883 to_int_type(
const char_type& __c)
noexcept
884 {
return int_type(__c); }
889 struct char_traits<char32_t>
891 typedef char32_t char_type;
892#ifdef __UINT_LEAST32_TYPE__
893 typedef __UINT_LEAST32_TYPE__ int_type;
894#elif defined _GLIBCXX_USE_C99_STDINT_TR1
895 typedef uint_least32_t int_type;
897 typedef make_unsigned<char32_t>::type int_type;
902 typedef mbstate_t state_type;
904#if __cpp_lib_three_way_comparison
905 using comparison_category = strong_ordering;
908 static _GLIBCXX17_CONSTEXPR
void
909 assign(char_type& __c1,
const char_type& __c2)
noexcept
911#if __cpp_constexpr_dynamic_alloc
912 if (std::__is_constant_evaluated())
913 std::construct_at(__builtin_addressof(__c1), __c2);
919 static constexpr bool
920 eq(
const char_type& __c1,
const char_type& __c2)
noexcept
921 {
return __c1 == __c2; }
923 static constexpr bool
924 lt(
const char_type& __c1,
const char_type& __c2)
noexcept
925 {
return __c1 < __c2; }
927 static _GLIBCXX17_CONSTEXPR
int
928 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
930 for (
size_t __i = 0; __i < __n; ++__i)
931 if (lt(__s1[__i], __s2[__i]))
933 else if (lt(__s2[__i], __s1[__i]))
938 static _GLIBCXX17_CONSTEXPR
size_t
939 length(
const char_type* __s)
942 while (!eq(__s[__i], char_type()))
947 static _GLIBCXX17_CONSTEXPR
const char_type*
948 find(
const char_type* __s,
size_t __n,
const char_type& __a)
950 for (
size_t __i = 0; __i < __n; ++__i)
951 if (eq(__s[__i], __a))
956 static _GLIBCXX20_CONSTEXPR char_type*
957 move(char_type* __s1,
const char_type* __s2,
size_t __n)
961#if __cplusplus >= 202002L
962 if (std::__is_constant_evaluated())
965 return (
static_cast<char_type*
>
966 (__builtin_memmove(__s1, __s2, __n *
sizeof(char_type))));
969 static _GLIBCXX20_CONSTEXPR char_type*
970 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
974#if __cplusplus >= 202002L
975 if (std::__is_constant_evaluated())
978 return (
static_cast<char_type*
>
979 (__builtin_memcpy(__s1, __s2, __n *
sizeof(char_type))));
982 static _GLIBCXX20_CONSTEXPR char_type*
983 assign(char_type* __s,
size_t __n, char_type __a)
985 for (
size_t __i = 0; __i < __n; ++__i)
986 assign(__s[__i], __a);
990 static constexpr char_type
991 to_char_type(
const int_type& __c)
noexcept
992 {
return char_type(__c); }
994 static constexpr int_type
995 to_int_type(
const char_type& __c)
noexcept
996 {
return int_type(__c); }
998 static constexpr bool
999 eq_int_type(
const int_type& __c1,
const int_type& __c2)
noexcept
1000 {
return __c1 == __c2; }
1003 static constexpr int_type
1005 {
return static_cast<int_type
>(-1); }
1007 static constexpr int_type
1008 not_eof(
const int_type& __c)
noexcept
1009 {
return eq_int_type(__c, eof()) ? 0 : __c; }
1013#if __cpp_lib_three_way_comparison
1016 template<
typename _ChTraits>
1018 __char_traits_cmp_cat(
int __cmp)
noexcept
1020 if constexpr (
requires {
typename _ChTraits::comparison_category; })
1022 using _Cat =
typename _ChTraits::comparison_category;
1023 static_assert( !is_void_v<common_comparison_category_t<_Cat>> );
1024 return static_cast<_Cat
>(__cmp <=> 0);
1027 return static_cast<weak_ordering
>(__cmp <=> 0);
1032#pragma GCC diagnostic pop
1034_GLIBCXX_END_NAMESPACE_VERSION
ISO C++ entities toplevel namespace is std.
fpos< mbstate_t > u32streampos
File position for char32_t streams.
long long streamoff
Type used by fpos, char_traits<char>, and char_traits<wchar_t>.
fpos< mbstate_t > u16streampos
File position for char16_t streams.
GNU extensions for public use.
Mapping from character type to associated types.
Base class used to implement std::char_traits.
Basis for explicit traits specializations.
Class representing stream positions.