Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Unified Diff: Source/wtf/RefPtr.h

Issue 170603003: Use nullptr_t for RefPtr, PassRefPtr and RawPtr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Final rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/wtf/RawPtr.h ('k') | Source/wtf/TypedArrayBase.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/RefPtr.h
diff --git a/Source/wtf/RefPtr.h b/Source/wtf/RefPtr.h
index 5d81f9366761634fcc7f250d72e5a5ba786bea65..22307b7033c03fc7d4f29a5dcb3e27669cc77bce 100644
--- a/Source/wtf/RefPtr.h
+++ b/Source/wtf/RefPtr.h
@@ -33,8 +33,11 @@ namespace WTF {
template<typename T> class PassRefPtr;
template<typename T> class RefPtr {
+ WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(RefPtr);
+ WTF_DISALLOW_ZERO_ASSIGNMENT(RefPtr);
public:
ALWAYS_INLINE RefPtr() : m_ptr(0) { }
+ ALWAYS_INLINE RefPtr(std::nullptr_t) : m_ptr(0) { }
ALWAYS_INLINE RefPtr(T* ptr) : m_ptr(ptr) { refIfNotNull(ptr); }
template<typename U> RefPtr(const RawPtr<U>& ptr, EnsurePtrConvertibleArgDecl(U, T)) : m_ptr(ptr.get()) { refIfNotNull(m_ptr); }
ALWAYS_INLINE explicit RefPtr(T& ref) : m_ptr(&ref) { m_ptr->ref(); }
@@ -67,9 +70,8 @@ namespace WTF {
RefPtr& operator=(const RefPtr&);
RefPtr& operator=(T*);
RefPtr& operator=(const PassRefPtr<T>&);
-#if !COMPILER_SUPPORTS(CXX_NULLPTR)
RefPtr& operator=(std::nullptr_t) { clear(); return *this; }
-#endif
+
template<typename U> RefPtr<T>& operator=(const RefPtr<U>&);
template<typename U> RefPtr<T>& operator=(const PassRefPtr<U>&);
template<typename U> RefPtr<T>& operator=(const RawPtr<U>&);
« no previous file with comments | « Source/wtf/RawPtr.h ('k') | Source/wtf/TypedArrayBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698