Revision: 15742
Author: [email protected]
Date: Thu Jul 18 02:25:54 2013
Log: Use C++11 deleted functions feature if available.
Implement DISALLOW_COPY_AND_ASSIGN and DISALLOW_IMPLICIT_CONSTRUCTORS
using C++11 deleted functions if possible.
[email protected]
Review URL: https://codereview.chromium.org/19728003
http://code.google.com/p/v8/source/detail?r=15742
Modified:
/branches/bleeding_edge/src/globals.h
=======================================
--- /branches/bleeding_edge/src/globals.h Wed Jul 10 08:32:39 2013
+++ /branches/bleeding_edge/src/globals.h Thu Jul 18 02:25:54 2013
@@ -325,13 +325,20 @@
F FUNCTION_CAST(Address addr) {
return reinterpret_cast<F>(reinterpret_cast<intptr_t>(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 @@
// 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)
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.