[libcxx] r215302 - Revert "Add some extra checks to the MoveOnly test class to ensure it is not constructed or assigned from in a moved-from state."

David Blaikie dblaikie at gmail.com
Sat Aug 9 15:42:19 PDT 2014


Author: dblaikie
Date: Sat Aug  9 17:42:19 2014
New Revision: 215302

URL: http://llvm.org/viewvc/llvm-project?rev=215302&view=rev
Log:
Revert "Add some extra checks to the MoveOnly test class to ensure it is not constructed or assigned from in a moved-from state."

Premature commit due to misreading CR feedback.

This reverts commit r215301.

Modified:
    libcxx/trunk/test/containers/MoveOnly.h

Modified: libcxx/trunk/test/containers/MoveOnly.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/MoveOnly.h?rev=215302&r1=215301&r2=215302&view=diff
==============================================================================
--- libcxx/trunk/test/containers/MoveOnly.h (original)
+++ libcxx/trunk/test/containers/MoveOnly.h Sat Aug  9 17:42:19 2014
@@ -22,17 +22,11 @@ class MoveOnly
 
     int data_;
 public:
-    MoveOnly(int data = 0) : data_(data) { assert(data != -1); }
-    MoveOnly(MoveOnly &&x) : data_(x.data_) {
-        assert(x.data_ != -1);
-        x.data_ = -1;
-    }
-    MoveOnly &operator=(MoveOnly &&x) {
-        assert(x.data_ != -1);
-        data_ = x.data_;
-        x.data_ = -1;
-        return *this;
-    }
+    MoveOnly(int data = 1) : data_(data) {}
+    MoveOnly(MoveOnly&& x)
+        : data_(x.data_) {x.data_ = 0;}
+    MoveOnly& operator=(MoveOnly&& x)
+        {data_ = x.data_; x.data_ = 0; return *this;}
 
     int get() const {return data_;}
 





More information about the cfe-commits mailing list