This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Specializations of std::char_traits


Pétur Runólfsson <peturr02@ru.is> writes:


[...]

|       static char_type* 
|       copy(char_type* __s1, const char_type* __s2, size_t __n)
|       {
|         memcpy(__s1, __s2, __n * sizeof(T));

         std::copy(__s2, __s2 + __n, __s1);


|         return __s1;
|       }
| 
|       static char_type* 
|       assign(char_type* __s, size_t __n, char_type __a)
|       {
|         char_type* __ret = __s;
|         while (__n--)
|           *__s++ = __a;
|         return __ret;

          std::fill_n(__s, __n, __a);

As of int_type, I was contemplating the idea of using the promoted-to
type of char_type.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]