From 2fb63453bdd24fff367b4ddb18c59b3972520728 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 21 Aug 2008 01:06:45 +0000 Subject: [PATCH] char_traits.h (char_traits:: assign(char_type*, size_t, char_type), [...]): For now, just open-code. 2008-08-20 Paolo Carlini * include/bits/char_traits.h (char_traits:: assign(char_type*, size_t, char_type), char_traits:: assign(char_type*, size_t, char_type)): For now, just open-code. From-SVN: r139367 --- libstdc++-v3/ChangeLog | 6 ++++ libstdc++-v3/include/bits/char_traits.h | 38 ++++++++++++++++--------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 80267a1be7c..64bfa342384 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2008-08-20 Paolo Carlini + + * include/bits/char_traits.h (char_traits:: + assign(char_type*, size_t, char_type), char_traits:: + assign(char_type*, size_t, char_type)): For now, just open-code. + 2008-08-20 Paolo Carlini PR c++/33979 (partial) diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h index 9dac2226237..77a634b66a3 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(_CHAR_TRAITS_EOF); } + eof() + { return static_cast(_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(WEOF); } + eof() + { return static_cast(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(-1); } + eof() + { return static_cast(-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(-1); } + eof() + { return static_cast(-1); } static int_type not_eof(const int_type& __c)