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]

[v3] Use the forwarding _Construct in uninitialized_copy


Hi,

now that _Construct forwards we can as well call it from
uninitialized_copy as we used to do in C++03 before implementing some
C++0x features using rvalue refs. Tested x86_64-linux.

Paolo.

////////////////
2009-09-02  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/stl_uninitialized.h
	(__uninitialized_copy::uninitialized_copy): Just call (the now 
	forwarding) _Construct.
Index: include/bits/stl_uninitialized.h
===================================================================
--- include/bits/stl_uninitialized.h	(revision 151285)
+++ include/bits/stl_uninitialized.h	(working copy)
@@ -71,8 +71,7 @@
 	  __try
 	    {
 	      for (; __first != __last; ++__first, ++__cur)
-		::new(static_cast<void*>(&*__cur)) typename
-		    iterator_traits<_ForwardIterator>::value_type(*__first);
+		std::_Construct(&*__cur, *__first);
 	      return __cur;
 	    }
 	  __catch(...)

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