33 #ifndef _POD_CHAR_TRAITS_H
34 #define _POD_CHAR_TRAITS_H 1
36 #pragma GCC system_header
40 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
42 _GLIBCXX_BEGIN_NAMESPACE_VERSION
49 template<
typename V,
typename I,
typename S = std::mbstate_t>
63 char_type ret = {
static_cast<value_type
>(v) };
69 to(
const char_type& c)
71 V2 ret = {
static_cast<V2
>(c.value) };
77 template<
typename V,
typename I,
typename S>
80 {
return lhs.value == rhs.value; }
82 template<
typename V,
typename I,
typename S>
85 {
return lhs.value < rhs.value; }
87 _GLIBCXX_END_NAMESPACE_VERSION
90 namespace std _GLIBCXX_VISIBILITY(default)
92 _GLIBCXX_BEGIN_NAMESPACE_VERSION
95 template<
typename V,
typename I,
typename S>
99 typedef typename char_type::int_type int_type;
100 typedef typename char_type::state_type state_type;
105 assign(char_type& __c1,
const char_type& __c2)
109 eq(
const char_type& __c1,
const char_type& __c2)
110 {
return __c1 == __c2; }
113 lt(
const char_type& __c1,
const char_type& __c2)
114 {
return __c1 < __c2; }
117 compare(
const char_type* __s1,
const char_type* __s2,
size_t __n)
119 for (
size_t __i = 0; __i < __n; ++__i)
120 if (!eq(__s1[__i], __s2[__i]))
121 return lt(__s1[__i], __s2[__i]) ? -1 : 1;
126 length(
const char_type* __s)
128 const char_type* __p = __s;
134 static const char_type*
135 find(
const char_type* __s,
size_t __n,
const char_type& __a)
137 for (
const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
144 move(char_type* __s1,
const char_type* __s2,
size_t __n)
146 return static_cast<char_type*
>
147 (__builtin_memmove(__s1, __s2, __n *
sizeof(char_type)));
151 copy(char_type* __s1,
const char_type* __s2,
size_t __n)
153 std::copy(__s2, __s2 + __n, __s1);
158 assign(char_type* __s,
size_t __n, char_type __a)
165 to_char_type(
const int_type& __i)
166 {
return char_type::template from(__i); }
169 to_int_type(
const char_type& __c)
170 {
return char_type::template to<int_type>(__c); }
173 eq_int_type(
const int_type& __c1,
const int_type& __c2)
174 {
return __c1 == __c2; }
179 int_type __r = { -1 };
184 not_eof(
const int_type& __c)
185 {
return eq_int_type(__c, eof()) ? int_type() : __c; }
188 _GLIBCXX_END_NAMESPACE_VERSION
Class representing stream positions.
long long streamoff
Type used by fpos, char_traits, and char_traits.
A POD class that serves as a character abstraction class.
GNU extensions for public use.
ISO C++ entities toplevel namespace is std.
Basis for explicit traits specializations.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
_OI fill_n(_OI __first, _Size __n, const _Tp &__value)
Fills the range [first,first+n) with copies of value.