git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157546
91177308-0d34-0410-b5e6-
96231b3b80d8
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
+#include <memory>
namespace llvm {
#if LLVM_USE_RVALUE_REFERENCES
IntrusiveRefCntPtr& operator=(IntrusiveRefCntPtr&& S) {
- Obj = S.Obj;
- S.Obj = 0;
+ this_type(std::move(S)).swap(*this);
return *this;
}
template <class X>
IntrusiveRefCntPtr& operator=(IntrusiveRefCntPtr<X>&& S) {
- Obj = S.getPtr();
- S.Obj = 0;
+ this_type(std::move(S)).swap(*this);
return *this;
}
#endif