char_traits.h (char_traits<char16_t>:: assign(char_type*, size_t, char_type), [....
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 21 Aug 2008 01:06:45 +0000 (01:06 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 21 Aug 2008 01:06:45 +0000 (01:06 +0000)
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.

From-SVN: r139367

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/char_traits.h

index 80267a1be7c8a52a9579ab94d0a9c2082df029eb..64bfa342384d919ec16d56f6be485454c4fc69d6 100644 (file)
@@ -1,3 +1,9 @@
+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)
index 9dac222623763765cb9aff11ce2ac13f44d51613..77a634b66a34525fd0632a580460a71f9ac19d94 100644 (file)
@@ -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)