You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by fa...@apache.org on 2007/10/23 14:56:41 UTC

svn commit: r587490 - /incubator/stdcxx/trunk/include/vector.cc

Author: faridz
Date: Tue Oct 23 05:56:41 2007
New Revision: 587490

URL: http://svn.apache.org/viewvc?rev=587490&view=rev
Log:
2007-10-23 Farid Zaripov <fa...@epam.com>

	Merged r587486 from branches/4.2.x
	* vector.cc (_C_insert_1): Reverted changes from r587164
	since the STDCXX-495 issue is deferred to 4.3 release.

Modified:
    incubator/stdcxx/trunk/include/vector.cc

Modified: incubator/stdcxx/trunk/include/vector.cc
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/vector.cc?rev=587490&r1=587489&r2=587490&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/vector.cc (original)
+++ incubator/stdcxx/trunk/include/vector.cc Tue Oct 23 05:56:41 2007
@@ -39,8 +39,6 @@
  * 
  **************************************************************************/
 
-#include <rw/_typetraits.h>   // for __rw_type_traits<>
-
 _RWSTD_NAMESPACE (std) { 
 
 template <class _TypeT, class _Allocator>
@@ -180,38 +178,12 @@
             // and bump up end()
             _C_push_back (*(_C_end - difference_type (1)));
 
-            if (__rw::__rw_type_traits<value_type>::_C_is_class) {
-                // save the pointer to allow inserting the value from self
-                const value_type* __px = &__x;
-
-                if (&*__it < __px && __px < &*__end) {
-                    // adjust the pointer if the inserting value
-                    // belongs the range (__it; __end)
-                    ++__px;
-                } else if (&*__it == __px) {
-                    // reset the pointer to 0 to avoid
-                    // self assignment __x = __x
-                    __px = 0;
-                }
-
-                // move the remaining elements from the range above one slot
-                // toward the end starting with the last element
-                _STD::copy_backward (__it, end () - 2, __end);
-
-                // overwrite the element at the given position
-                if (__px)
-                    *__it = *__px;
-            } else {
-                // save the copy to allow inserting the value from self
-                const value_type __tmp = __x;
-
-                // move the remaining elements from the range above one slot
-                // toward the end starting with the last element
-                _STD::copy_backward (__it, end () - 2, __end);
-
-                // overwrite the element at the given position
-                *__it = __tmp;
-            }
+            // move the remaining elements from the range above one slot
+            // toward the end starting with the last element
+            _STD::copy_backward (__it, end () - 2, __end);
+
+            // overwrite the element at the given position
+            *__it = __x;
         }
         else {
             // construct a copy of the value to be inserted