32 #ifndef _POD_CHAR_TRAITS_H
33 #define _POD_CHAR_TRAITS_H 1
37 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
39 _GLIBCXX_BEGIN_NAMESPACE_VERSION
46 template<
typename V,
typename I,
typename S = std::mbstate_t>
60 char_type ret = {
static_cast<value_type
>(v) };
66 to(
const char_type& c)
68 V2 ret = {
static_cast<V2
>(c.value) };
74 template<
typename V,
typename I,
typename S>
77 {
return lhs.value == rhs.value; }
79 template<
typename V,
typename I,
typename S>
82 {
return lhs.value < rhs.value; }
84 _GLIBCXX_END_NAMESPACE_VERSION
87 namespace std _GLIBCXX_VISIBILITY(default)
89 _GLIBCXX_BEGIN_NAMESPACE_VERSION
92 template<
typename V,
typename I,
typename S>
96 typedef typename char_type::int_type int_type;
97 typedef typename char_type::state_type state_type;
102 assign(char_type& __c1,
const char_type& __c2)
106 eq(
const char_type& __c1,
const char_type& __c2)
107 {
return __c1 == __c2; }
110 lt(
const char_type& __c1,
const char_type& __c2)
111 {
return __c1 < __c2; }
114 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
116 for (
size_t __i = 0; __i < __n; ++__i)
117 if (!eq(__s1[__i], __s2[__i]))
118 return lt(__s1[__i], __s2[__i]) ? -1 : 1;
123 length(
const char_type* __s)
125 const char_type* __p = __s;
131 static const char_type*
132 find(
const char_type* __s,
size_t __n,
const char_type& __a)
134 for (
const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
141 move(char_type* __s1,
const char_type* __s2,
size_t __n)
143 return static_cast<char_type*
>
144 (__builtin_memmove(__s1, __s2, __n *
sizeof(char_type)));
148 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
150 std::copy(__s2, __s2 + __n, __s1);
155 assign(char_type* __s,
size_t __n, char_type __a)
162 to_char_type(
const int_type& __i)
163 {
return char_type::template from(__i); }
166 to_int_type(
const char_type& __c)
167 {
return char_type::template to<int_type>(__c); }
170 eq_int_type(
const int_type& __c1,
const int_type& __c2)
171 {
return __c1 == __c2; }
176 int_type __r = { -1 };
181 not_eof(
const int_type& __c)
182 {
return eq_int_type(__c, eof()) ? int_type() : __c; }
185 _GLIBCXX_END_NAMESPACE_VERSION
long long streamoff
Type used by fpos, char_traits, and char_traits.
Basis for explicit traits specializations.
_OI fill_n(_OI __first, _Size __n, const _Tp &__value)
Fills the range [first,first+n) with copies of value.
ISO C++ entities toplevel namespace is std.
A POD class that serves as a character abstraction class.
GNU extensions for public use.
std::remove_reference< _Tp >::type && move(_Tp &&__t)
Move a value.
Class representing stream positions.