Changeset 10745 for code/branches/cpp11_v2/src/libraries
- Timestamp:
- Nov 1, 2015, 10:06:23 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/libraries
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/object/StrongPtr.h
r10744 r10745 172 172 } 173 173 174 /// Move-constructor 175 inline StrongPtr(StrongPtr&& other) : pointer_(other.pointer_), base_(other.base_) 176 { 177 other.pointer_ = nullptr; 178 other.base_ = nullptr; 179 } 180 174 181 /// Destructor: Decrements the reference counter. 175 182 inline ~StrongPtr() … … 187 194 188 195 /// Assigns the wrapped pointer of another StrongPtr. 189 inline StrongPtr& operator=( const StrongPtr&other)190 { 191 StrongPtr(other).swap(*this);196 inline StrongPtr& operator=(StrongPtr other) 197 { 198 other.swap(*this); 192 199 return *this; 193 200 } -
code/branches/cpp11_v2/src/libraries/core/object/WeakPtr.h
r10744 r10745 137 137 138 138 /// Assigns the wrapped pointer of another WeakPtr. 139 inline WeakPtr& operator=( const WeakPtr&other)140 { 141 WeakPtr(other).swap(*this);139 inline WeakPtr& operator=(WeakPtr other) 140 { 141 other.swap(*this); 142 142 return *this; 143 143 } -
code/branches/cpp11_v2/src/libraries/util/SharedPtr.h
r10624 r10745 245 245 } 246 246 247 /// Move-constructor, this SharedPtr now points to the same object like the other SharedPtr did before 248 inline SharedPtr(SharedPtr&& other) : pointer_(other.pointer_), counter_(other.counter_) 249 { 250 other.pointer_ = nullptr; 251 other.counter_ = nullptr; 252 } 253 247 254 /// Destructor, decrements the counter and deletes the object if the counter becomes zero. 248 255 inline ~SharedPtr() … … 261 268 262 269 /// Assigns a new object, decrements the counter of the old object, increments the counter of the new object. 263 inline SharedPtr& operator=( const SharedPtr&other)264 { 265 SharedPtr(other).swap(*this);270 inline SharedPtr& operator=(SharedPtr other) 271 { 272 other.swap(*this); 266 273 return *this; 267 274 }
Note: See TracChangeset
for help on using the changeset viewer.