diff options
-rw-r--r-- | src/node.cc | 3 | ||||
-rw-r--r-- | src/node_file.cc | 4 | ||||
-rw-r--r-- | src/util.h | 6 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/node.cc b/src/node.cc index eaf2277579..6aaf306827 100644 --- a/src/node.cc +++ b/src/node.cc @@ -165,8 +165,7 @@ class ArrayBufferAllocator : public ArrayBuffer::Allocator { virtual void Free(void* data, size_t length) override; private: ArrayBufferAllocator() {} - ArrayBufferAllocator(const ArrayBufferAllocator&); - void operator=(const ArrayBufferAllocator&); + DISALLOW_COPY_AND_ASSIGN(ArrayBufferAllocator); }; ArrayBufferAllocator ArrayBufferAllocator::the_singleton; diff --git a/src/node_file.cc b/src/node_file.cc index 86474b75fa..dec90b5291 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -248,10 +248,8 @@ static void After(uv_fs_t *req) { struct fs_req_wrap { fs_req_wrap() {} ~fs_req_wrap() { uv_fs_req_cleanup(&req); } - // Ensure that copy ctor and assignment operator are not used. - fs_req_wrap(const fs_req_wrap& req); - fs_req_wrap& operator=(const fs_req_wrap& req); uv_fs_t req; + DISALLOW_COPY_AND_ASSIGN(fs_req_wrap); }; diff --git a/src/util.h b/src/util.h index 4f0de82d56..7bafe79e30 100644 --- a/src/util.h +++ b/src/util.h @@ -34,8 +34,10 @@ namespace node { (node::OneByteString((isolate), (string), sizeof(string) - 1)) #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ - void operator=(const TypeName&); \ - TypeName(const TypeName&) + void operator=(const TypeName&) = delete; \ + void operator=(TypeName&&) = delete; \ + TypeName(const TypeName&) = delete; \ + TypeName(TypeName&&) = delete #if defined(NDEBUG) # define ASSERT(expression) |