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)
266#if __cplusplus >= 202002L
267 if (std::__is_constant_evaluated())
269 for (std::size_t __i = 0; __i < __n; ++__i)
270 std::construct_at(__s1 + __i, __s2[__i]);
275 __builtin_memcpy(__s1, __s2, __n *
sizeof(char_type));
279 template<
typename _CharT>
281 typename char_traits<_CharT>::char_type*
282 char_traits<_CharT>::
283 assign(char_type* __s, std::size_t __n, char_type __a)
285#if __cplusplus >= 202002L
286 if (std::__is_constant_evaluated())
288 for (std::size_t __i = 0; __i < __n; ++__i)
289 std::construct_at(__s + __i, __a);
294 if _GLIBCXX17_CONSTEXPR (
sizeof(_CharT) == 1 && __is_trivial(_CharT))
297 __builtin_memcpy(&__c, __builtin_addressof(__a), 1);
298 __builtin_memset(__s, __c, __n);
302 for (std::size_t __i = 0; __i < __n; ++__i)
308_GLIBCXX_END_NAMESPACE_VERSION
311namespace std _GLIBCXX_VISIBILITY(default)
313_GLIBCXX_BEGIN_NAMESPACE_VERSION
315#ifdef __cpp_lib_is_constant_evaluated
317# define __cpp_lib_constexpr_char_traits 201811L
318#elif __cplusplus >= 201703L && _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
320# define __cpp_lib_constexpr_char_traits 201611L
336 template<
typename _CharT>
345 typedef char char_type;
346 typedef int int_type;
350 typedef mbstate_t state_type;
352#if __cpp_lib_three_way_comparison
353 using comparison_category = strong_ordering;
356 static _GLIBCXX17_CONSTEXPR
void
357 assign(char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
359#if __cpp_constexpr_dynamic_alloc
360 if (std::__is_constant_evaluated())
361 std::construct_at(__builtin_addressof(__c1), __c2);
367 static _GLIBCXX_CONSTEXPR
bool
368 eq(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
369 {
return __c1 == __c2; }
371 static _GLIBCXX_CONSTEXPR
bool
372 lt(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
375 return (
static_cast<unsigned char>(__c1)
376 <
static_cast<unsigned char>(__c2));
379 static _GLIBCXX17_CONSTEXPR
int
380 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
384#if __cplusplus >= 201703L
385 if (std::__is_constant_evaluated())
387 for (
size_t __i = 0; __i < __n; ++__i)
388 if (lt(__s1[__i], __s2[__i]))
390 else if (lt(__s2[__i], __s1[__i]))
395 return __builtin_memcmp(__s1, __s2, __n);
398 static _GLIBCXX17_CONSTEXPR
size_t
399 length(
const char_type* __s)
401#if __cplusplus >= 201703L
402 if (std::__is_constant_evaluated())
405 return __builtin_strlen(__s);
408 static _GLIBCXX17_CONSTEXPR
const char_type*
409 find(
const char_type* __s,
size_t __n,
const char_type& __a)
413#if __cplusplus >= 201703L
414 if (std::__is_constant_evaluated())
417 return static_cast<const char_type*
>(__builtin_memchr(__s, __a, __n));
420 static _GLIBCXX20_CONSTEXPR char_type*
421 move(char_type* __s1,
const char_type* __s2,
size_t __n)
425#if __cplusplus >= 202002L
426 if (std::__is_constant_evaluated())
429 return static_cast<char_type*
>(__builtin_memmove(__s1, __s2, __n));
432 static _GLIBCXX20_CONSTEXPR char_type*
433 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
437#if __cplusplus >= 202002L
438 if (std::__is_constant_evaluated())
441 return static_cast<char_type*
>(__builtin_memcpy(__s1, __s2, __n));
444 static _GLIBCXX20_CONSTEXPR char_type*
445 assign(char_type* __s,
size_t __n, char_type __a)
449#if __cplusplus >= 202002L
450 if (std::__is_constant_evaluated())
453 return static_cast<char_type*
>(__builtin_memset(__s, __a, __n));
456 static _GLIBCXX_CONSTEXPR char_type
457 to_char_type(
const int_type& __c) _GLIBCXX_NOEXCEPT
458 {
return static_cast<char_type
>(__c); }
462 static _GLIBCXX_CONSTEXPR int_type
463 to_int_type(
const char_type& __c) _GLIBCXX_NOEXCEPT
464 {
return static_cast<int_type
>(
static_cast<unsigned char>(__c)); }
466 static _GLIBCXX_CONSTEXPR
bool
467 eq_int_type(
const int_type& __c1,
const int_type& __c2) _GLIBCXX_NOEXCEPT
468 {
return __c1 == __c2; }
470#ifdef _GLIBCXX_STDIO_EOF
471 static _GLIBCXX_CONSTEXPR int_type
472 eof() _GLIBCXX_NOEXCEPT
473 {
return static_cast<int_type
>(_GLIBCXX_STDIO_EOF); }
475 static _GLIBCXX_CONSTEXPR int_type
476 not_eof(
const int_type& __c) _GLIBCXX_NOEXCEPT
477 {
return (__c == eof()) ? 0 : __c; }
482#ifdef _GLIBCXX_USE_WCHAR_T
487 typedef wchar_t char_type;
488 typedef wint_t int_type;
492 typedef mbstate_t state_type;
494#if __cpp_lib_three_way_comparison
495 using comparison_category = strong_ordering;
498 static _GLIBCXX17_CONSTEXPR
void
499 assign(char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
501#if __cpp_constexpr_dynamic_alloc
502 if (std::__is_constant_evaluated())
503 std::construct_at(__builtin_addressof(__c1), __c2);
509 static _GLIBCXX_CONSTEXPR
bool
510 eq(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
511 {
return __c1 == __c2; }
513 static _GLIBCXX_CONSTEXPR
bool
514 lt(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
515 {
return __c1 < __c2; }
517 static _GLIBCXX17_CONSTEXPR
int
518 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
522#if __cplusplus >= 201703L
523 if (std::__is_constant_evaluated())
526 return wmemcmp(__s1, __s2, __n);
529 static _GLIBCXX17_CONSTEXPR
size_t
530 length(
const char_type* __s)
532#if __cplusplus >= 201703L
533 if (std::__is_constant_evaluated())
539 static _GLIBCXX17_CONSTEXPR
const char_type*
540 find(
const char_type* __s,
size_t __n,
const char_type& __a)
544#if __cplusplus >= 201703L
545 if (std::__is_constant_evaluated())
548 return wmemchr(__s, __a, __n);
551 static _GLIBCXX20_CONSTEXPR char_type*
552 move(char_type* __s1,
const char_type* __s2,
size_t __n)
556#if __cplusplus >= 202002L
557 if (std::__is_constant_evaluated())
560 return wmemmove(__s1, __s2, __n);
563 static _GLIBCXX20_CONSTEXPR char_type*
564 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
568#if __cplusplus >= 202002L
569 if (std::__is_constant_evaluated())
572 return wmemcpy(__s1, __s2, __n);
575 static _GLIBCXX20_CONSTEXPR char_type*
576 assign(char_type* __s,
size_t __n, char_type __a)
580#if __cplusplus >= 202002L
581 if (std::__is_constant_evaluated())
584 return wmemset(__s, __a, __n);
587 static _GLIBCXX_CONSTEXPR char_type
588 to_char_type(
const int_type& __c) _GLIBCXX_NOEXCEPT
589 {
return char_type(__c); }
591 static _GLIBCXX_CONSTEXPR int_type
592 to_int_type(
const char_type& __c) _GLIBCXX_NOEXCEPT
593 {
return int_type(__c); }
595 static _GLIBCXX_CONSTEXPR
bool
596 eq_int_type(
const int_type& __c1,
const int_type& __c2) _GLIBCXX_NOEXCEPT
597 {
return __c1 == __c2; }
600 static _GLIBCXX_CONSTEXPR int_type
601 eof() _GLIBCXX_NOEXCEPT
602 {
return static_cast<int_type
>(WEOF); }
604 static _GLIBCXX_CONSTEXPR int_type
605 not_eof(
const int_type& __c) _GLIBCXX_NOEXCEPT
606 {
return eq_int_type(__c, eof()) ? 0 : __c; }
615#ifdef _GLIBCXX_USE_CHAR8_T
617 struct char_traits<char8_t>
619 typedef char8_t char_type;
620 typedef unsigned int int_type;
622 typedef u8streampos pos_type;
624 typedef mbstate_t state_type;
626#if __cpp_lib_three_way_comparison
627 using comparison_category = strong_ordering;
630 static _GLIBCXX17_CONSTEXPR
void
631 assign(char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
633#if __cpp_constexpr_dynamic_alloc
634 if (std::__is_constant_evaluated())
635 std::construct_at(__builtin_addressof(__c1), __c2);
641 static _GLIBCXX_CONSTEXPR
bool
642 eq(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
643 {
return __c1 == __c2; }
645 static _GLIBCXX_CONSTEXPR
bool
646 lt(
const char_type& __c1,
const char_type& __c2) _GLIBCXX_NOEXCEPT
647 {
return __c1 < __c2; }
649 static _GLIBCXX17_CONSTEXPR
int
650 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
654#if __cplusplus >= 201703L
655 if (std::__is_constant_evaluated())
658 return __builtin_memcmp(__s1, __s2, __n);
661 static _GLIBCXX17_CONSTEXPR
size_t
662 length(
const char_type* __s)
664#if __cplusplus >= 201703L
665 if (std::__is_constant_evaluated())
669 while (!eq(__s[__i], char_type()))
674 static _GLIBCXX17_CONSTEXPR
const char_type*
675 find(
const char_type* __s,
size_t __n,
const char_type& __a)
679#if __cplusplus >= 201703L
680 if (std::__is_constant_evaluated())
683 return static_cast<const char_type*
>(__builtin_memchr(__s, __a, __n));
686 static _GLIBCXX20_CONSTEXPR char_type*
687 move(char_type* __s1,
const char_type* __s2,
size_t __n)
691#if __cplusplus >= 202002L
692 if (std::__is_constant_evaluated())
695 return static_cast<char_type*
>(__builtin_memmove(__s1, __s2, __n));
698 static _GLIBCXX20_CONSTEXPR char_type*
699 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
703#if __cplusplus >= 202002L
704 if (std::__is_constant_evaluated())
707 return static_cast<char_type*
>(__builtin_memcpy(__s1, __s2, __n));
710 static _GLIBCXX20_CONSTEXPR char_type*
711 assign(char_type* __s,
size_t __n, char_type __a)
715#if __cplusplus >= 202002L
716 if (std::__is_constant_evaluated())
719 return static_cast<char_type*
>(__builtin_memset(__s, __a, __n));
722 static _GLIBCXX_CONSTEXPR char_type
723 to_char_type(
const int_type& __c) _GLIBCXX_NOEXCEPT
724 {
return char_type(__c); }
726 static _GLIBCXX_CONSTEXPR int_type
727 to_int_type(
const char_type& __c) _GLIBCXX_NOEXCEPT
728 {
return int_type(__c); }
730 static _GLIBCXX_CONSTEXPR
bool
731 eq_int_type(
const int_type& __c1,
const int_type& __c2) _GLIBCXX_NOEXCEPT
732 {
return __c1 == __c2; }
735 static _GLIBCXX_CONSTEXPR int_type
736 eof() _GLIBCXX_NOEXCEPT
737 {
return static_cast<int_type
>(-1); }
739 static _GLIBCXX_CONSTEXPR int_type
740 not_eof(
const int_type& __c) _GLIBCXX_NOEXCEPT
741 {
return eq_int_type(__c, eof()) ? 0 : __c; }
746_GLIBCXX_END_NAMESPACE_VERSION
749#if __cplusplus >= 201103L
751namespace std _GLIBCXX_VISIBILITY(default)
753_GLIBCXX_BEGIN_NAMESPACE_VERSION
756 struct char_traits<char16_t>
758 typedef char16_t char_type;
759#ifdef __UINT_LEAST16_TYPE__
760 typedef __UINT_LEAST16_TYPE__ int_type;
761#elif defined _GLIBCXX_USE_C99_STDINT_TR1
762 typedef uint_least16_t int_type;
764 typedef make_unsigned<char16_t>::type int_type;
769 typedef mbstate_t state_type;
771#if __cpp_lib_three_way_comparison
772 using comparison_category = strong_ordering;
775 static _GLIBCXX17_CONSTEXPR
void
776 assign(char_type& __c1,
const char_type& __c2)
noexcept
778#if __cpp_constexpr_dynamic_alloc
779 if (std::__is_constant_evaluated())
780 std::construct_at(__builtin_addressof(__c1), __c2);
786 static constexpr bool
787 eq(
const char_type& __c1,
const char_type& __c2)
noexcept
788 {
return __c1 == __c2; }
790 static constexpr bool
791 lt(
const char_type& __c1,
const char_type& __c2)
noexcept
792 {
return __c1 < __c2; }
794 static _GLIBCXX17_CONSTEXPR
int
795 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
797 for (
size_t __i = 0; __i < __n; ++__i)
798 if (lt(__s1[__i], __s2[__i]))
800 else if (lt(__s2[__i], __s1[__i]))
805 static _GLIBCXX17_CONSTEXPR
size_t
806 length(
const char_type* __s)
809 while (!eq(__s[__i], char_type()))
814 static _GLIBCXX17_CONSTEXPR
const char_type*
815 find(
const char_type* __s,
size_t __n,
const char_type& __a)
817 for (
size_t __i = 0; __i < __n; ++__i)
818 if (eq(__s[__i], __a))
823 static _GLIBCXX20_CONSTEXPR char_type*
824 move(char_type* __s1,
const char_type* __s2,
size_t __n)
828#if __cplusplus >= 202002L
829 if (std::__is_constant_evaluated())
832 return (
static_cast<char_type*
>
833 (__builtin_memmove(__s1, __s2, __n *
sizeof(char_type))));
836 static _GLIBCXX20_CONSTEXPR char_type*
837 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
841#if __cplusplus >= 202002L
842 if (std::__is_constant_evaluated())
845 return (
static_cast<char_type*
>
846 (__builtin_memcpy(__s1, __s2, __n *
sizeof(char_type))));
849 static _GLIBCXX20_CONSTEXPR char_type*
850 assign(char_type* __s,
size_t __n, char_type __a)
852 for (
size_t __i = 0; __i < __n; ++__i)
853 assign(__s[__i], __a);
857 static constexpr char_type
858 to_char_type(
const int_type& __c)
noexcept
859 {
return char_type(__c); }
861 static constexpr bool
862 eq_int_type(
const int_type& __c1,
const int_type& __c2)
noexcept
863 {
return __c1 == __c2; }
866 static constexpr int_type
867 to_int_type(
const char_type& __c)
noexcept
868 {
return __c == eof() ? int_type(0xfffd) : int_type(__c); }
870 static constexpr int_type
872 {
return static_cast<int_type
>(-1); }
874 static constexpr int_type
875 not_eof(
const int_type& __c)
noexcept
876 {
return eq_int_type(__c, eof()) ? 0 : __c; }
878 static constexpr int_type
879 to_int_type(
const char_type& __c)
noexcept
880 {
return int_type(__c); }
885 struct char_traits<char32_t>
887 typedef char32_t char_type;
888#ifdef __UINT_LEAST32_TYPE__
889 typedef __UINT_LEAST32_TYPE__ int_type;
890#elif defined _GLIBCXX_USE_C99_STDINT_TR1
891 typedef uint_least32_t int_type;
893 typedef make_unsigned<char32_t>::type int_type;
898 typedef mbstate_t state_type;
900#if __cpp_lib_three_way_comparison
901 using comparison_category = strong_ordering;
904 static _GLIBCXX17_CONSTEXPR
void
905 assign(char_type& __c1,
const char_type& __c2)
noexcept
907#if __cpp_constexpr_dynamic_alloc
908 if (std::__is_constant_evaluated())
909 std::construct_at(__builtin_addressof(__c1), __c2);
915 static constexpr bool
916 eq(
const char_type& __c1,
const char_type& __c2)
noexcept
917 {
return __c1 == __c2; }
919 static constexpr bool
920 lt(
const char_type& __c1,
const char_type& __c2)
noexcept
921 {
return __c1 < __c2; }
923 static _GLIBCXX17_CONSTEXPR
int
924 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
926 for (
size_t __i = 0; __i < __n; ++__i)
927 if (lt(__s1[__i], __s2[__i]))
929 else if (lt(__s2[__i], __s1[__i]))
934 static _GLIBCXX17_CONSTEXPR
size_t
935 length(
const char_type* __s)
938 while (!eq(__s[__i], char_type()))
943 static _GLIBCXX17_CONSTEXPR
const char_type*
944 find(
const char_type* __s,
size_t __n,
const char_type& __a)
946 for (
size_t __i = 0; __i < __n; ++__i)
947 if (eq(__s[__i], __a))
952 static _GLIBCXX20_CONSTEXPR char_type*
953 move(char_type* __s1,
const char_type* __s2,
size_t __n)
957#if __cplusplus >= 202002L
958 if (std::__is_constant_evaluated())
961 return (
static_cast<char_type*
>
962 (__builtin_memmove(__s1, __s2, __n *
sizeof(char_type))));
965 static _GLIBCXX20_CONSTEXPR char_type*
966 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
970#if __cplusplus >= 202002L
971 if (std::__is_constant_evaluated())
974 return (
static_cast<char_type*
>
975 (__builtin_memcpy(__s1, __s2, __n *
sizeof(char_type))));
978 static _GLIBCXX20_CONSTEXPR char_type*
979 assign(char_type* __s,
size_t __n, char_type __a)
981 for (
size_t __i = 0; __i < __n; ++__i)
982 assign(__s[__i], __a);
986 static constexpr char_type
987 to_char_type(
const int_type& __c)
noexcept
988 {
return char_type(__c); }
990 static constexpr int_type
991 to_int_type(
const char_type& __c)
noexcept
992 {
return int_type(__c); }
994 static constexpr bool
995 eq_int_type(
const int_type& __c1,
const int_type& __c2)
noexcept
996 {
return __c1 == __c2; }
999 static constexpr int_type
1001 {
return static_cast<int_type
>(-1); }
1003 static constexpr int_type
1004 not_eof(
const int_type& __c)
noexcept
1005 {
return eq_int_type(__c, eof()) ? 0 : __c; }
1009#if __cpp_lib_three_way_comparison
1012 template<
typename _ChTraits>
1014 __char_traits_cmp_cat(
int __cmp)
noexcept
1016 if constexpr (
requires {
typename _ChTraits::comparison_category; })
1018 using _Cat =
typename _ChTraits::comparison_category;
1019 static_assert( !is_void_v<common_comparison_category_t<_Cat>> );
1020 return static_cast<_Cat
>(__cmp <=> 0);
1023 return static_cast<weak_ordering
>(__cmp <=> 0);
1028#pragma GCC diagnostic pop
1030_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.