This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[v3] Minor patch to basic_string constructors


Hi,

tested x86-linux, committed to mainline.

Paolo.

/////////////
2004-01-27  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/basic_string.tcc
	(basic_string(const basic_string&, size_type, size_type),
	basic_string(const basic_string&, size_type, size_type,
	const _Alloc&)): Avoid unnecessarily constructing iterators.
diff -urN libstdc++-v3-orig/include/bits/basic_string.tcc libstdc++-v3/include/bits/basic_string.tcc
--- libstdc++-v3-orig/include/bits/basic_string.tcc	2004-01-26 21:01:10.000000000 +0100
+++ libstdc++-v3/include/bits/basic_string.tcc	2004-01-27 11:18:01.000000000 +0100
@@ -207,10 +207,10 @@
   template<typename _CharT, typename _Traits, typename _Alloc>
     basic_string<_CharT, _Traits, _Alloc>::
     basic_string(const basic_string& __str, size_type __pos, size_type __n)
-    : _M_dataplus(_S_construct(__str._M_ibegin()
+    : _M_dataplus(_S_construct(__str._M_data()
 			       + __str._M_check(__pos,
 						"basic_string::basic_string"),
-			       __str._M_ibegin() + __pos
+			       __str._M_data() + __pos 
 			       + __str._M_limit(__pos, __n),
 			       _Alloc()), _Alloc())
     { }
@@ -219,10 +219,10 @@
     basic_string<_CharT, _Traits, _Alloc>::
     basic_string(const basic_string& __str, size_type __pos,
 		 size_type __n, const _Alloc& __a)
-    : _M_dataplus(_S_construct(__str._M_ibegin()
+    : _M_dataplus(_S_construct(__str._M_data()
 			       + __str._M_check(__pos,
 						"basic_string::basic_string"),
-			       __str._M_ibegin() + __pos
+			       __str._M_data() + __pos
 			       + __str._M_limit(__pos, __n), __a), __a)
     { }
 

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