Index: base/memory/ref_counted.h |
diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h |
index 9c9aea12e83784509d851c5e67e8da1291b34695..ff46e6d6e5a9c87782b449474fbbebc4e0865454 100644 |
--- a/base/memory/ref_counted.h |
+++ b/base/memory/ref_counted.h |
@@ -7,7 +7,6 @@ |
#include <stddef.h> |
-#include <algorithm> |
#include <cassert> |
#include <iosfwd> |
#include <type_traits> |
@@ -355,7 +354,15 @@ |
return *this; |
} |
- void swap(scoped_refptr<T>& r) { std::swap(ptr_, r.ptr_); } |
+ void swap(T** pp) { |
+ T* p = ptr_; |
+ ptr_ = *pp; |
+ *pp = p; |
+ } |
+ |
+ void swap(scoped_refptr<T>& r) { |
+ swap(&r.ptr_); |
+ } |
explicit operator bool() const { return ptr_ != nullptr; } |