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())
231 if (__builtin_constant_p(__s2 < __s1)
232 && __s1 > __s2 && __s1 < (__s2 + __n))
237 assign(__s1[__n], __s2[__n]);
242 copy(__s1, __s2, __n);
246 __builtin_memmove(__s1, __s2, __n *
sizeof(char_type));
250 template<
typename _CharT>
252 typename char_traits<_CharT>::char_type*
253 char_traits<_CharT>::
254 copy(char_type* __s1,
const char_type* __s2, std::size_t __n)
258#if __cplusplus >= 202002L
259 if (std::__is_constant_evaluated())
261 for (std::size_t __i = 0; __i < __n; ++__i)
262 std::construct_at(__s1 + __i, __s2[__i]);
266 __builtin_memcpy(__s1, __s2, __n *
sizeof(char_type));
270 template<
typename _CharT>
272 typename char_traits<_CharT>::char_type*
273 char_traits<_CharT>::
274 assign(char_type* __s, std::size_t __n, char_type __a)
276#if __cplusplus >= 202002L
277 if (std::__is_constant_evaluated())
279 for (std::size_t __i = 0; __i < __n; ++__i)
280 std::construct_at(__s + __i, __a);
285 if _GLIBCXX17_CONSTEXPR (
sizeof(_CharT) == 1 && __is_trivial(_CharT))
290 __builtin_memcpy(&__c, __builtin_addressof(__a), 1);
291 __builtin_memset(__s, __c, __n);
296 for (std::size_t __i = 0; __i < __n; ++__i)
302_GLIBCXX_END_NAMESPACE_VERSION
305namespace std _GLIBCXX_VISIBILITY(default)
307_GLIBCXX_BEGIN_NAMESPACE_VERSION
309#ifdef __cpp_lib_is_constant_evaluated
311# define __cpp_lib_constexpr_char_traits 201811L
312#elif __cplusplus >= 201703L && _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
314# define __cpp_lib_constexpr_char_traits 201611L
330 template<
typename _CharT>
339 typedef char char_type;
340 typedef int int_type;
344 typedef mbstate_t state_type;
346#if __cpp_lib_three_way_comparison
347 using comparison_category = strong_ordering;
350 static _GLIBCXX17_CONSTEXPR
void
351 assign(char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
353#if __cpp_constexpr_dynamic_alloc
354 if (std::__is_constant_evaluated())
355 std::construct_at(__builtin_addressof(__c1), __c2);
361 static _GLIBCXX_CONSTEXPR
bool
362 eq(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
363 {
return __c1 == __c2; }
365 static _GLIBCXX_CONSTEXPR
bool
366 lt(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
369 return (
static_cast<unsigned char>(__c1)
370 <
static_cast<unsigned char>(__c2));
373 static _GLIBCXX17_CONSTEXPR
int
374 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
378#if __cplusplus >= 201703L
379 if (std::__is_constant_evaluated())
381 for (
size_t __i = 0; __i < __n; ++__i)
382 if (lt(__s1[__i], __s2[__i]))
384 else if (lt(__s2[__i], __s1[__i]))
389 return __builtin_memcmp(__s1, __s2, __n);
392 static _GLIBCXX17_CONSTEXPR
size_t
393 length(
const char_type* __s)
395#if __cplusplus >= 201703L
396 if (std::__is_constant_evaluated())
399 return __builtin_strlen(__s);
402 static _GLIBCXX17_CONSTEXPR
const char_type*
403 find(
const char_type* __s,
size_t __n,
const char_type& __a)
407#if __cplusplus >= 201703L
408 if (std::__is_constant_evaluated())
411 return static_cast<const char_type*
>(__builtin_memchr(__s, __a, __n));
414 static _GLIBCXX20_CONSTEXPR char_type*
415 move(char_type* __s1,
const char_type* __s2,
size_t __n)
419#if __cplusplus >= 202002L
420 if (std::__is_constant_evaluated())
423 return static_cast<char_type*
>(__builtin_memmove(__s1, __s2, __n));
426 static _GLIBCXX20_CONSTEXPR char_type*
427 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
431#if __cplusplus >= 202002L
432 if (std::__is_constant_evaluated())
435 return static_cast<char_type*
>(__builtin_memcpy(__s1, __s2, __n));
438 static _GLIBCXX20_CONSTEXPR char_type*
439 assign(char_type* __s,
size_t __n, char_type __a)
443#if __cplusplus >= 202002L
444 if (std::__is_constant_evaluated())
447 return static_cast<char_type*
>(__builtin_memset(__s, __a, __n));
450 static _GLIBCXX_CONSTEXPR char_type
451 to_char_type(
const int_type& __c) _GLIBCXX_NOEXCEPT
452 {
return static_cast<char_type
>(__c); }
456 static _GLIBCXX_CONSTEXPR int_type
457 to_int_type(
const char_type& __c) _GLIBCXX_NOEXCEPT
458 {
return static_cast<int_type
>(
static_cast<unsigned char>(__c)); }
460 static _GLIBCXX_CONSTEXPR
bool
461 eq_int_type(
const int_type& __c1,
const int_type& __c2) _GLIBCXX_NOEXCEPT
462 {
return __c1 == __c2; }
464#ifdef _GLIBCXX_STDIO_EOF
465 static _GLIBCXX_CONSTEXPR int_type
466 eof() _GLIBCXX_NOEXCEPT
467 {
return static_cast<int_type
>(_GLIBCXX_STDIO_EOF); }
469 static _GLIBCXX_CONSTEXPR int_type
470 not_eof(
const int_type& __c) _GLIBCXX_NOEXCEPT
471 {
return (__c == eof()) ? 0 : __c; }
476#ifdef _GLIBCXX_USE_WCHAR_T
481 typedef wchar_t char_type;
482 typedef wint_t int_type;
486 typedef mbstate_t state_type;
488#if __cpp_lib_three_way_comparison
489 using comparison_category = strong_ordering;
492 static _GLIBCXX17_CONSTEXPR
void
493 assign(char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
495#if __cpp_constexpr_dynamic_alloc
496 if (std::__is_constant_evaluated())
497 std::construct_at(__builtin_addressof(__c1), __c2);
503 static _GLIBCXX_CONSTEXPR
bool
504 eq(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
505 {
return __c1 == __c2; }
507 static _GLIBCXX_CONSTEXPR
bool
508 lt(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
509 {
return __c1 < __c2; }
511 static _GLIBCXX17_CONSTEXPR
int
512 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
516#if __cplusplus >= 201703L
517 if (std::__is_constant_evaluated())
520 return wmemcmp(__s1, __s2, __n);
523 static _GLIBCXX17_CONSTEXPR
size_t
524 length(
const char_type* __s)
526#if __cplusplus >= 201703L
527 if (std::__is_constant_evaluated())
533 static _GLIBCXX17_CONSTEXPR
const char_type*
534 find(
const char_type* __s,
size_t __n,
const char_type& __a)
538#if __cplusplus >= 201703L
539 if (std::__is_constant_evaluated())
542 return wmemchr(__s, __a, __n);
545 static _GLIBCXX20_CONSTEXPR char_type*
546 move(char_type* __s1,
const char_type* __s2,
size_t __n)
550#if __cplusplus >= 202002L
551 if (std::__is_constant_evaluated())
554 return wmemmove(__s1, __s2, __n);
557 static _GLIBCXX20_CONSTEXPR char_type*
558 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
562#if __cplusplus >= 202002L
563 if (std::__is_constant_evaluated())
566 return wmemcpy(__s1, __s2, __n);
569 static _GLIBCXX20_CONSTEXPR char_type*
570 assign(char_type* __s,
size_t __n, char_type __a)
574#if __cplusplus >= 202002L
575 if (std::__is_constant_evaluated())
578 return wmemset(__s, __a, __n);
581 static _GLIBCXX_CONSTEXPR char_type
582 to_char_type(
const int_type& __c) _GLIBCXX_NOEXCEPT
583 {
return char_type(__c); }
585 static _GLIBCXX_CONSTEXPR int_type
586 to_int_type(
const char_type& __c) _GLIBCXX_NOEXCEPT
587 {
return int_type(__c); }
589 static _GLIBCXX_CONSTEXPR
bool
590 eq_int_type(
const int_type& __c1,
const int_type& __c2) _GLIBCXX_NOEXCEPT
591 {
return __c1 == __c2; }
594 static _GLIBCXX_CONSTEXPR int_type
595 eof() _GLIBCXX_NOEXCEPT
596 {
return static_cast<int_type
>(WEOF); }
598 static _GLIBCXX_CONSTEXPR int_type
599 not_eof(
const int_type& __c) _GLIBCXX_NOEXCEPT
600 {
return eq_int_type(__c, eof()) ? 0 : __c; }
609#ifdef _GLIBCXX_USE_CHAR8_T
611 struct char_traits<char8_t>
613 typedef char8_t char_type;
614 typedef unsigned int int_type;
616 typedef u8streampos pos_type;
618 typedef mbstate_t state_type;
620#if __cpp_lib_three_way_comparison
621 using comparison_category = strong_ordering;
624 static _GLIBCXX17_CONSTEXPR
void
625 assign(char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
627#if __cpp_constexpr_dynamic_alloc
628 if (std::__is_constant_evaluated())
629 std::construct_at(__builtin_addressof(__c1), __c2);
635 static _GLIBCXX_CONSTEXPR
bool
636 eq(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
637 {
return __c1 == __c2; }
639 static _GLIBCXX_CONSTEXPR
bool
640 lt(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
641 {
return __c1 < __c2; }
643 static _GLIBCXX17_CONSTEXPR
int
644 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
648#if __cplusplus >= 201703L
649 if (std::__is_constant_evaluated())
652 return __builtin_memcmp(__s1, __s2, __n);
655 static _GLIBCXX17_CONSTEXPR
size_t
656 length(
const char_type* __s)
658#if __cplusplus >= 201703L
659 if (std::__is_constant_evaluated())
663 while (!eq(__s[__i], char_type()))
668 static _GLIBCXX17_CONSTEXPR
const char_type*
669 find(
const char_type* __s,
size_t __n,
const char_type& __a)
673#if __cplusplus >= 201703L
674 if (std::__is_constant_evaluated())
677 return static_cast<const char_type*
>(__builtin_memchr(__s, __a, __n));
680 static _GLIBCXX20_CONSTEXPR char_type*
681 move(char_type* __s1,
const char_type* __s2,
size_t __n)
685#if __cplusplus >= 202002L
686 if (std::__is_constant_evaluated())
689 return static_cast<char_type*
>(__builtin_memmove(__s1, __s2, __n));
692 static _GLIBCXX20_CONSTEXPR char_type*
693 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
697#if __cplusplus >= 202002L
698 if (std::__is_constant_evaluated())
701 return static_cast<char_type*
>(__builtin_memcpy(__s1, __s2, __n));
704 static _GLIBCXX20_CONSTEXPR char_type*
705 assign(char_type* __s,
size_t __n, char_type __a)
709#if __cplusplus >= 202002L
710 if (std::__is_constant_evaluated())
713 return static_cast<char_type*
>(__builtin_memset(__s, __a, __n));
716 static _GLIBCXX_CONSTEXPR char_type
717 to_char_type(
const int_type& __c) _GLIBCXX_NOEXCEPT
718 {
return char_type(__c); }
720 static _GLIBCXX_CONSTEXPR int_type
721 to_int_type(
const char_type& __c) _GLIBCXX_NOEXCEPT
722 {
return int_type(__c); }
724 static _GLIBCXX_CONSTEXPR
bool
725 eq_int_type(
const int_type& __c1,
const int_type& __c2) _GLIBCXX_NOEXCEPT
726 {
return __c1 == __c2; }
729 static _GLIBCXX_CONSTEXPR int_type
730 eof() _GLIBCXX_NOEXCEPT
731 {
return static_cast<int_type
>(-1); }
733 static _GLIBCXX_CONSTEXPR int_type
734 not_eof(
const int_type& __c) _GLIBCXX_NOEXCEPT
735 {
return eq_int_type(__c, eof()) ? 0 : __c; }
740_GLIBCXX_END_NAMESPACE_VERSION
743#if __cplusplus >= 201103L
745namespace std _GLIBCXX_VISIBILITY(default)
747_GLIBCXX_BEGIN_NAMESPACE_VERSION
750 struct char_traits<char16_t>
752 typedef char16_t char_type;
753#ifdef __UINT_LEAST16_TYPE__
754 typedef __UINT_LEAST16_TYPE__ int_type;
755#elif defined _GLIBCXX_USE_C99_STDINT_TR1
756 typedef uint_least16_t int_type;
758 typedef make_unsigned<char16_t>::type int_type;
763 typedef mbstate_t state_type;
765#if __cpp_lib_three_way_comparison
766 using comparison_category = strong_ordering;
769 static _GLIBCXX17_CONSTEXPR
void
770 assign(char_type& __c1,
const char_type& __c2)
noexcept
772#if __cpp_constexpr_dynamic_alloc
773 if (std::__is_constant_evaluated())
774 std::construct_at(__builtin_addressof(__c1), __c2);
780 static constexpr bool
781 eq(
const char_type& __c1,
const char_type& __c2)
noexcept
782 {
return __c1 == __c2; }
784 static constexpr bool
785 lt(
const char_type& __c1,
const char_type& __c2)
noexcept
786 {
return __c1 < __c2; }
788 static _GLIBCXX17_CONSTEXPR
int
789 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
791 for (
size_t __i = 0; __i < __n; ++__i)
792 if (lt(__s1[__i], __s2[__i]))
794 else if (lt(__s2[__i], __s1[__i]))
799 static _GLIBCXX17_CONSTEXPR
size_t
800 length(
const char_type* __s)
803 while (!eq(__s[__i], char_type()))
808 static _GLIBCXX17_CONSTEXPR
const char_type*
809 find(
const char_type* __s,
size_t __n,
const char_type& __a)
811 for (
size_t __i = 0; __i < __n; ++__i)
812 if (eq(__s[__i], __a))
817 static _GLIBCXX20_CONSTEXPR char_type*
818 move(char_type* __s1,
const char_type* __s2,
size_t __n)
822#if __cplusplus >= 202002L
823 if (std::__is_constant_evaluated())
826 return (
static_cast<char_type*
>
827 (__builtin_memmove(__s1, __s2, __n *
sizeof(char_type))));
830 static _GLIBCXX20_CONSTEXPR char_type*
831 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
835#if __cplusplus >= 202002L
836 if (std::__is_constant_evaluated())
839 return (
static_cast<char_type*
>
840 (__builtin_memcpy(__s1, __s2, __n *
sizeof(char_type))));
843 static _GLIBCXX20_CONSTEXPR char_type*
844 assign(char_type* __s,
size_t __n, char_type __a)
846 for (
size_t __i = 0; __i < __n; ++__i)
847 assign(__s[__i], __a);
851 static constexpr char_type
852 to_char_type(
const int_type& __c)
noexcept
853 {
return char_type(__c); }
855 static constexpr bool
856 eq_int_type(
const int_type& __c1,
const int_type& __c2)
noexcept
857 {
return __c1 == __c2; }
860 static constexpr int_type
861 to_int_type(
const char_type& __c)
noexcept
862 {
return __c == eof() ? int_type(0xfffd) : int_type(__c); }
864 static constexpr int_type
866 {
return static_cast<int_type
>(-1); }
868 static constexpr int_type
869 not_eof(
const int_type& __c)
noexcept
870 {
return eq_int_type(__c, eof()) ? 0 : __c; }
872 static constexpr int_type
873 to_int_type(
const char_type& __c)
noexcept
874 {
return int_type(__c); }
879 struct char_traits<char32_t>
881 typedef char32_t char_type;
882#ifdef __UINT_LEAST32_TYPE__
883 typedef __UINT_LEAST32_TYPE__ int_type;
884#elif defined _GLIBCXX_USE_C99_STDINT_TR1
885 typedef uint_least32_t int_type;
887 typedef make_unsigned<char32_t>::type int_type;
892 typedef mbstate_t state_type;
894#if __cpp_lib_three_way_comparison
895 using comparison_category = strong_ordering;
898 static _GLIBCXX17_CONSTEXPR
void
899 assign(char_type& __c1,
const char_type& __c2)
noexcept
901#if __cpp_constexpr_dynamic_alloc
902 if (std::__is_constant_evaluated())
903 std::construct_at(__builtin_addressof(__c1), __c2);
909 static constexpr bool
910 eq(
const char_type& __c1,
const char_type& __c2)
noexcept
911 {
return __c1 == __c2; }
913 static constexpr bool
914 lt(
const char_type& __c1,
const char_type& __c2)
noexcept
915 {
return __c1 < __c2; }
917 static _GLIBCXX17_CONSTEXPR
int
918 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
920 for (
size_t __i = 0; __i < __n; ++__i)
921 if (lt(__s1[__i], __s2[__i]))
923 else if (lt(__s2[__i], __s1[__i]))
928 static _GLIBCXX17_CONSTEXPR
size_t
929 length(
const char_type* __s)
932 while (!eq(__s[__i], char_type()))
937 static _GLIBCXX17_CONSTEXPR
const char_type*
938 find(
const char_type* __s,
size_t __n,
const char_type& __a)
940 for (
size_t __i = 0; __i < __n; ++__i)
941 if (eq(__s[__i], __a))
946 static _GLIBCXX20_CONSTEXPR char_type*
947 move(char_type* __s1,
const char_type* __s2,
size_t __n)
951#if __cplusplus >= 202002L
952 if (std::__is_constant_evaluated())
955 return (
static_cast<char_type*
>
956 (__builtin_memmove(__s1, __s2, __n *
sizeof(char_type))));
959 static _GLIBCXX20_CONSTEXPR char_type*
960 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
964#if __cplusplus >= 202002L
965 if (std::__is_constant_evaluated())
968 return (
static_cast<char_type*
>
969 (__builtin_memcpy(__s1, __s2, __n *
sizeof(char_type))));
972 static _GLIBCXX20_CONSTEXPR char_type*
973 assign(char_type* __s,
size_t __n, char_type __a)
975 for (
size_t __i = 0; __i < __n; ++__i)
976 assign(__s[__i], __a);
980 static constexpr char_type
981 to_char_type(
const int_type& __c)
noexcept
982 {
return char_type(__c); }
984 static constexpr int_type
985 to_int_type(
const char_type& __c)
noexcept
986 {
return int_type(__c); }
988 static constexpr bool
989 eq_int_type(
const int_type& __c1,
const int_type& __c2)
noexcept
990 {
return __c1 == __c2; }
993 static constexpr int_type
995 {
return static_cast<int_type
>(-1); }
997 static constexpr int_type
998 not_eof(
const int_type& __c)
noexcept
999 {
return eq_int_type(__c, eof()) ? 0 : __c; }
1003#if __cpp_lib_three_way_comparison
1006 template<
typename _ChTraits>
1008 __char_traits_cmp_cat(
int __cmp)
noexcept
1010 if constexpr (
requires {
typename _ChTraits::comparison_category; })
1012 using _Cat =
typename _ChTraits::comparison_category;
1013 static_assert( !is_void_v<common_comparison_category_t<_Cat>> );
1014 return static_cast<_Cat
>(__cmp <=> 0);
1017 return static_cast<weak_ordering
>(__cmp <=> 0);
1022#pragma GCC diagnostic pop
1024_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.