llvm.org GIT mirror llvm / 5acc40a
IntrusiveRefCntPtr: Use the same pattern as the other operator= overloads when using rvalue refs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157546 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 8 years ago
1 changed file(s) with 3 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
2222
2323 #include "llvm/Support/Casting.h"
2424 #include "llvm/Support/Compiler.h"
25 #include
2526
2627 namespace llvm {
2728
145146
146147 #if LLVM_USE_RVALUE_REFERENCES
147148 IntrusiveRefCntPtr& operator=(IntrusiveRefCntPtr&& S) {
148 Obj = S.Obj;
149 S.Obj = 0;
149 this_type(std::move(S)).swap(*this);
150150 return *this;
151151 }
152152
153153 template
154154 IntrusiveRefCntPtr& operator=(IntrusiveRefCntPtr&& S) {
155 Obj = S.getPtr();
156 S.Obj = 0;
155 this_type(std::move(S)).swap(*this);
157156 return *this;
158157 }
159158 #endif