diff options
Diffstat (limited to 'deps/v8/src/base/macros.h')
-rw-r--r-- | deps/v8/src/base/macros.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/deps/v8/src/base/macros.h b/deps/v8/src/base/macros.h index 8a2efe61a9..8a088ffc40 100644 --- a/deps/v8/src/base/macros.h +++ b/deps/v8/src/base/macros.h @@ -109,19 +109,15 @@ V8_INLINE Dest bit_cast(Source const& source) { } // Explicitly declare the assignment operator as deleted. -#define DISALLOW_ASSIGN(TypeName) TypeName& operator=(const TypeName&) = delete; +#define DISALLOW_ASSIGN(TypeName) TypeName& operator=(const TypeName&) = delete // Explicitly declare the copy constructor and assignment operator as deleted. +// This also deletes the implicit move constructor and implicit move assignment +// operator, but still allows to manually define them. #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&) = delete; \ DISALLOW_ASSIGN(TypeName) -// Explicitly declare all copy/move constructors and assignments as deleted. -#define DISALLOW_COPY_AND_MOVE_AND_ASSIGN(TypeName) \ - TypeName(TypeName&&) = delete; \ - TypeName& operator=(TypeName&&) = delete; \ - DISALLOW_COPY_AND_ASSIGN(TypeName) - // Explicitly declare all implicit constructors as deleted, namely the // default constructor, copy constructor and operator= functions. // This is especially useful for classes containing only static methods. @@ -385,7 +381,7 @@ constexpr inline T RoundUp(T x) { } template <typename T, typename U> -inline bool IsAligned(T value, U alignment) { +constexpr inline bool IsAligned(T value, U alignment) { return (value & (alignment - 1)) == 0; } |