Index: Source/wtf/RawPtr.h |
diff --git a/Source/wtf/RawPtr.h b/Source/wtf/RawPtr.h |
index 439d1c2f3b2c43716764446073ced77cd9c41ec9..5fa5480fc34d2014d55ecc596e1263a3f0dc5a4d 100644 |
--- a/Source/wtf/RawPtr.h |
+++ b/Source/wtf/RawPtr.h |
@@ -44,8 +44,11 @@ namespace WTF { |
template<typename T> |
class RawPtr { |
+ WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(RawPtr); |
+ WTF_DISALLOW_ZERO_ASSIGNMENT(RawPtr); |
public: |
RawPtr() : m_ptr(0) { } |
+ RawPtr(std::nullptr_t) : m_ptr(0) { } |
RawPtr(T* ptr) : m_ptr(ptr) { } |
RawPtr(const RawPtr& other) |
: m_ptr(other.get()) |
@@ -87,6 +90,12 @@ public: |
return *this; |
} |
+ RawPtr& operator=(std::nullptr_t) |
+ { |
+ m_ptr = 0; |
+ return *this; |
+ } |
+ |
operator T*() const { return m_ptr; } |
T& operator*() const { return *m_ptr; } |
T* operator->() const { return m_ptr; } |