stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r507940 - /incubator/stdcxx/trunk/include/deque
Date Thu, 15 Feb 2007 14:36:05 GMT
Author: faridz
Date: Thu Feb 15 06:36:04 2007
New Revision: 507940

URL: http://svn.apache.org/viewvc?view=rev&rev=507940
Log:
2007-02-15 Farid Zaripov <faridz@kyiv.vdiweb.com>

	STDCXX-127
	* deque (swap): Corrected _C_beg._C_node and _C_end._C_node
	after swap operation for empty container.

Modified:
    incubator/stdcxx/trunk/include/deque

Modified: incubator/stdcxx/trunk/include/deque
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/deque?view=diff&rev=507940&r1=507939&r2=507940
==============================================================================
--- incubator/stdcxx/trunk/include/deque (original)
+++ incubator/stdcxx/trunk/include/deque Thu Feb 15 06:36:04 2007
@@ -904,6 +904,30 @@
         _STD::swap (_C_end,       __rhs._C_end);
         _STD::swap (_C_nodes,     __rhs._C_nodes);
         _STD::swap (_C_node_size, __rhs._C_node_size);
+
+        if (pointer() == _C_beg._C_cur) {
+            _RWSTD_ASSERT (pointer() == _C_end._C_cur);
+            _RWSTD_ASSERT (   _C_beg._C_node == &__rhs._C_end._C_cur
+                           && _C_end._C_node == &__rhs._C_end._C_cur);
+
+            _C_beg._C_node =
+            _C_end._C_node = &_C_end._C_cur;
+        }
+        else {
+            _RWSTD_ASSERT (pointer() != _C_end._C_cur);
+        }
+
+        if (pointer() == __rhs._C_beg._C_cur) {
+            _RWSTD_ASSERT (pointer() == __rhs._C_end._C_cur);
+            _RWSTD_ASSERT (   __rhs._C_beg._C_node == &_C_end._C_cur
+                           && __rhs._C_end._C_node == &_C_end._C_cur);
+
+            __rhs._C_beg._C_node =
+            __rhs._C_end._C_node = &__rhs._C_end._C_cur;
+        }
+        else {
+            _RWSTD_ASSERT (pointer() != __rhs._C_end._C_cur);
+        }
     }
     else {
         deque __tmp (*this);



Mime
View raw message