This is the mail archive of the libstdc++@sourceware.cygnus.com 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]

basic_string<> - patch


The _S_construct function call the _S_copy_chars function.
_S_copy_chars is a template function with a specialization for const _CharT*.
It is to few. 
I added three specializations, for _CharT*, iterator and const_iterator.

I expected the specializations for const _CharT* and const_iterator would
be enough, but it is not the case :-( we need the specializations
for _CharT* and iterator too.


1999-06-08  Ryszard Kabatek <kabatek@chemie.uni-halle.de>

	* bits/basic_string.h:
	  basic_string<>::_S_copy_chars<> - add specializations for 
	  _CharT*, iterator and const_iterator.


Ryszard Kabatek
Martin-Luther University Halle-Wittenberg, Department of Physical Chemistry
Geusaer Str. 88, 06217 Merseburg, Germany
Tel. +49 3461 46 2487 (2466) Fax. +49 3461 46 2129
Index: bits/basic_string.h
===================================================================
RCS file: /cvs/libstdc++/libstdc++/bits/basic_string.h,v
retrieving revision 1.35
diff -c -2 -p -r1.35 basic_string.h
*** basic_string.h	1999/06/08 01:09:14	1.35
--- basic_string.h	1999/06/08 09:29:09
*************** namespace std {
*** 276,279 ****
--- 276,291 ----
        { traits_type::copy(__p, __j1, __j2 - __j1); }
  
+       static void
+       _S_copy_chars(_CharT* __p, _CharT* __j1, _CharT* __j2)
+       { traits_type::copy(__p, __j1, __j2 - __j1); }
+ 
+       static void
+       _S_copy_chars(_CharT* __p, const_iterator __j1, const_iterator __j2)
+       { _S_copy_chars(__p, __j1.base(), __j2.base()); }
+ 
+       static void
+       _S_copy_chars(_CharT* __p, iterator __j1, iterator __j2)
+       { _S_copy_chars(__p, __j1.base(), __j2.base()); }
+ 
        void 
        _M_mutate(size_type __nsize, size_type __keep, size_type __keep_end);

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