stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r697885 - /stdcxx/branches/4.2.x/include/rw/_specialized.h
Date Mon, 22 Sep 2008 16:12:52 GMT
Author: faridz
Date: Mon Sep 22 09:12:52 2008
New Revision: 697885

URL: http://svn.apache.org/viewvc?rev=697885&view=rev
Log:
2008-09-22  Farid Zaripov  <faridz@apache.org>

	STDCXX-976
	* include/rw/_specialized.h: Reverted r694675.
	(uninitialized_copy): Use ::new() instead of __rw::__rw_construct().

Modified:
    stdcxx/branches/4.2.x/include/rw/_specialized.h

Modified: stdcxx/branches/4.2.x/include/rw/_specialized.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_specialized.h?rev=697885&r1=697884&r2=697885&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/include/rw/_specialized.h (original)
+++ stdcxx/branches/4.2.x/include/rw/_specialized.h Mon Sep 22 09:12:52 2008
@@ -52,6 +52,11 @@
 #endif   // _RWSTD_RW_NEW_H_INCLUDED
 
 
+#ifndef _RWSTD_RW_ITERBASE_H_INCLUDED
+#  include <rw/_iterbase.h>
+#endif   // _RWSTD_RW_ITERBASE_H_INCLUDED
+
+
 _RWSTD_NAMESPACE (__rw) { 
 
 
@@ -93,29 +98,12 @@
 
 template <class _TypeT, class _TypeU>
 inline void
-__rw_construct (_TypeT* __p, const _TypeU& __val)
-{
-    ::new (_RWSTD_STATIC_CAST (void*, __p)) _TypeT (__val);
-}
-
-
-template <class _TypeT, class _TypeU>
-inline void
 __rw_construct (volatile _TypeT* __p, _TypeU& __val)
 {
     // remove volatile before invoking operator new
     __rw_construct (_RWSTD_CONST_CAST (_TypeT*, __p), __val);
 }
 
-
-template <class _TypeT, class _TypeU>
-inline void
-__rw_construct (volatile _TypeT* __p, const _TypeU& __val)
-{
-    // remove volatile before invoking operator new
-    __rw_construct (_RWSTD_CONST_CAST (_TypeT*, __p), __val);
-}
-
 #else   // #ifdef _RWSTD_NO_PART_SPEC_OVERLOAD
 
 template <class _TypeT, class _TypeU>
@@ -179,10 +167,14 @@
                     _ForwardIterator __res)
 {
     const _ForwardIterator __start = __res;
+    typedef _TYPENAME iterator_traits<_ForwardIterator>::value_type _TypeT;
 
     _TRY {
-        for (; __first != __last; ++__first, ++__res)
-            _RW::__rw_construct (&*__res, *__first);
+        for (; __first != __last; ++__first, ++__res) {
+            volatile void* const __ptr =
+                _RWSTD_STATIC_CAST (volatile void*, &*__res);
+            ::new (_RWSTD_CONST_CAST (void*, __ptr)) _TypeT (*__first);
+        }
     }
     _CATCH (...) {
         _RW::__rw_destroy (__start, __res);



Mime
View raw message