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. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215302 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5eb396a8e6
commit
ddcbcd6b5e
@ -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_;}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user