This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[v3] Use the forwarding _Construct in uninitialized_copy
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 01 Sep 2009 23:37:30 +0200
- Subject: [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(...)