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

Unified Diff: Source/wtf/NullPtr.h

Issue 17959002: Disallow C++11 compilers from constructing OwnPtrs from 0 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add a macro to disallow construction from zero Created 7 years, 5 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 | « no previous file | Source/wtf/OwnPtr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/NullPtr.h
diff --git a/Source/wtf/NullPtr.h b/Source/wtf/NullPtr.h
index 7bba3940ea1ff1371c4ff57b088a5768fc26078f..d40a7bd8f3ff6077a1dd6ae7d6fa50ab055cf886 100644
--- a/Source/wtf/NullPtr.h
+++ b/Source/wtf/NullPtr.h
@@ -53,4 +53,14 @@ extern std::nullptr_t nullptr;
#endif
+#if COMPILER_SUPPORTS(CXX_DELETED_FUNCTIONS)
+#define WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(ClassName) \
+ private: \
+ ClassName(int) = delete
+#else
+#define WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(ClassName) \
+ private: \
+ ClassName(int)
+#endif
+
#endif
« no previous file with comments | « no previous file | Source/wtf/OwnPtr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698