From 8714b8bb89f1cc23df662f872039219f5b053691 Mon Sep 17 00:00:00 2001 From: Junjie Bai Date: Wed, 13 Mar 2019 01:01:13 -0700 Subject: [PATCH] Mark DispatchTable move ctor and move assignment operator as deleted (#17948) Summary: ``` 21:39:50 /var/lib/jenkins/workspace/aten/src/ATen/core/dispatch/DispatchTable.h:125:3: warning: explicitly defaulted move constructor is implicitly deleted [-Wdefaulted-function-deleted] 21:39:50 DispatchTable(DispatchTable&&) = default; 21:39:50 ^ 21:39:50 /var/lib/jenkins/workspace/aten/src/ATen/core/dispatch/DispatchTable.h:212:36: note: move constructor of 'DispatchTable' is implicitly deleted because field 'kernels_' has a deleted move constructor 21:39:50 detail::ThreadsafeOperatorTable_ kernels_; 21:39:50 ^ 21:39:50 /var/lib/jenkins/workspace/aten/src/ATen/core/dispatch/DispatchTable.h:105:68: note: copy constructor of 'ThreadsafeOperatorTable_' is implicitly deleted because field 'map_' has a deleted copy constructor 21:39:50 LeftRight> map_; 21:39:50 ^ 21:39:50 /var/lib/jenkins/workspace/c10/util/LeftRight.h:152:16: note: copy constructor of 'LeftRight, std::equal_to, std::allocator > > >' is implicitly deleted because field '_writeMutex' has a deleted copy constructor 21:39:50 std::mutex _writeMutex; 21:39:50 ^ 21:39:50 /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/mutex:129:5: note: 'mutex' has been explicitly marked deleted here 21:39:50 mutex(const mutex&) = delete; ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/17948 Reviewed By: ezyang Differential Revision: D14431344 Pulled By: bddppq fbshipit-source-id: b1c6593b73cb467a58b09a3470b8899b82564d5e --- aten/src/ATen/core/dispatch/DispatchTable.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aten/src/ATen/core/dispatch/DispatchTable.h b/aten/src/ATen/core/dispatch/DispatchTable.h index 665a8d5..08e43c4 100644 --- a/aten/src/ATen/core/dispatch/DispatchTable.h +++ b/aten/src/ATen/core/dispatch/DispatchTable.h @@ -122,8 +122,8 @@ class DispatchTable final { , dispatch_strategy_(get_dispatch_strategy_(schema)) , operator_name_(schema.name()) {} - DispatchTable(DispatchTable&&) = default; - DispatchTable& operator=(DispatchTable&&) = default; + DispatchTable(DispatchTable&&) = delete; + DispatchTable& operator=(DispatchTable&&) = delete; DispatchTable(const DispatchTable&) = delete; DispatchTable& operator=(const DispatchTable&) = delete; -- 2.7.4