aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/include/bits/char_traits.h38
2 files changed, 31 insertions, 13 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 80267a1..64bfa34 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,11 @@
2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
+ * include/bits/char_traits.h (char_traits<char16_t>::
+ assign(char_type*, size_t, char_type), char_traits<char32_t>::
+ assign(char_type*, size_t, char_type)): For now, just open-code.
+
+2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
+
PR c++/33979 (partial)
* include/bits/postypes.h (u16streampos, u32streampos): Add.
* include/bits/char_traits.h (char_traits<char16_t>,
diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h
index 9dac222..77a634b 100644
--- a/libstdc++-v3/include/bits/char_traits.h
+++ b/libstdc++-v3/include/bits/char_traits.h
@@ -298,7 +298,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return __c1 == __c2; }
static int_type
- eof() { return static_cast<int_type>(_CHAR_TRAITS_EOF); }
+ eof()
+ { return static_cast<int_type>(_CHAR_TRAITS_EOF); }
static int_type
not_eof(const int_type& __c)
@@ -354,17 +355,20 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return wmemset(__s, __a, __n); }
static char_type
- to_char_type(const int_type& __c) { return char_type(__c); }
+ to_char_type(const int_type& __c)
+ { return char_type(__c); }
static int_type
- to_int_type(const char_type& __c) { return int_type(__c); }
+ to_int_type(const char_type& __c)
+ { return int_type(__c); }
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
static int_type
- eof() { return static_cast<int_type>(WEOF); }
+ eof()
+ { return static_cast<int_type>(WEOF); }
static int_type
not_eof(const int_type& __c)
@@ -447,23 +451,27 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
- {
- std::fill_n(__s, __n, __a);
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ assign(__s[__i], __a);
return __s;
}
static char_type
- to_char_type(const int_type& __c) { return char_type(__c); }
+ to_char_type(const int_type& __c)
+ { return char_type(__c); }
static int_type
- to_int_type(const char_type& __c) { return int_type(__c); }
+ to_int_type(const char_type& __c)
+ { return int_type(__c); }
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
static int_type
- eof() { return static_cast<int_type>(-1); }
+ eof()
+ { return static_cast<int_type>(-1); }
static int_type
not_eof(const int_type& __c)
@@ -537,22 +545,26 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
{
- std::fill_n(__s, __n, __a);
+ for (size_t __i = 0; __i < __n; ++__i)
+ assign(__s[__i], __a);
return __s;
}
static char_type
- to_char_type(const int_type& __c) { return char_type(__c); }
+ to_char_type(const int_type& __c)
+ { return char_type(__c); }
static int_type
- to_int_type(const char_type& __c) { return int_type(__c); }
+ to_int_type(const char_type& __c)
+ { return int_type(__c); }
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
static int_type
- eof() { return static_cast<int_type>(-1); }
+ eof()
+ { return static_cast<int_type>(-1); }
static int_type
not_eof(const int_type& __c)