Index: base/memory/ref_counted.h |
diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h |
index be4919c1a51908699c260936f4f6b3c62a98d9ab..4eab2dda5c0591a8e19a0f1ae38fafe5250b3c1c 100644 |
--- a/base/memory/ref_counted.h |
+++ b/base/memory/ref_counted.h |
@@ -303,13 +303,15 @@ class scoped_refptr { |
operator T*() const { return ptr_; } |
#endif |
+ explicit operator bool() const { return ptr_ != nullptr; } |
+ |
T& operator*() const { |
- assert(ptr_ != NULL); |
+ assert(ptr_ != nullptr); |
return *ptr_; |
} |
T* operator->() const { |
- assert(ptr_ != NULL); |
+ assert(ptr_ != nullptr); |
return ptr_; |
} |