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