Chromium Code Reviews| Index: webrtc/base/scoped_ref_ptr.h |
| diff --git a/webrtc/base/scoped_ref_ptr.h b/webrtc/base/scoped_ref_ptr.h |
| index ceee445216a3ce6af300c7830f19f528049e4c2c..df669121dcf77ecdc36b43e86906412e7d66e024 100644 |
| --- a/webrtc/base/scoped_ref_ptr.h |
| +++ b/webrtc/base/scoped_ref_ptr.h |
| @@ -63,7 +63,7 @@ |
| #ifndef WEBRTC_BASE_SCOPED_REF_PTR_H_ |
| #define WEBRTC_BASE_SCOPED_REF_PTR_H_ |
| -#include <stddef.h> |
| +#include <memory> |
| namespace rtc { |
| @@ -134,6 +134,17 @@ class scoped_refptr { |
| return *this = r.get(); |
| } |
| + scoped_refptr<T>& operator=(scoped_refptr<T>&& r) { |
| + scoped_refptr<T>(std::move(r)).swap(*this); |
|
Taylor Brandstetter
2016/08/01 20:00:36
I realize this uses the same method as Chromium's
|
| + return *this; |
| + } |
| + |
| + template <typename U> |
| + scoped_refptr<T>& operator=(scoped_refptr<U>&& r) { |
| + scoped_refptr<T>(std::move(r)).swap(*this); |
| + return *this; |
| + } |
| + |
| void swap(T** pp) { |
| T* p = ptr_; |
| ptr_ = *pp; |