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

Unified Diff: src/globals.h

Issue 19728003: Use C++11 deleted functions feature if available. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Just check for C++ version. 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index f00e676dde9866b9eb7bb2005d80ed4766da46a2..e695e94d4e6b465b555edc405f588d6ab0ec287d 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -327,11 +327,18 @@ F FUNCTION_CAST(Address addr) {
}
+#if __cplusplus >= 201103L
+#define DISALLOW_BY_DELETE = delete
+#else
+#define DISALLOW_BY_DELETE
+#endif
+
+
// A macro to disallow the evil copy constructor and operator= functions
// This should be used in the private: declarations for a class
-#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
- TypeName(const TypeName&); \
- void operator=(const TypeName&)
+#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&) DISALLOW_BY_DELETE; \
+ void operator=(const TypeName&) DISALLOW_BY_DELETE
// A macro to disallow all the implicit constructors, namely the
@@ -341,7 +348,7 @@ F FUNCTION_CAST(Address addr) {
// that wants to prevent anyone from instantiating it. This is
// especially useful for classes containing only static methods.
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
- TypeName(); \
+ TypeName() DISALLOW_BY_DELETE; \
DISALLOW_COPY_AND_ASSIGN(TypeName)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698