From 2163b3424b1c9c8f072a69486896c0d625010788 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 21 Apr 2020 09:49:03 -0600 Subject: [PATCH] Explicitly =delete copy operators for TaskDescriptor. --- include/deal.II/base/thread_management.h | 34 +++++------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/include/deal.II/base/thread_management.h b/include/deal.II/base/thread_management.h index 4568730caa..73d40394db 100644 --- a/include/deal.II/base/thread_management.h +++ b/include/deal.II/base/thread_management.h @@ -1294,10 +1294,10 @@ namespace Threads TaskDescriptor(); /** - * Copy constructor. Throws an exception since we want to make sure that - * each TaskDescriptor object corresponds to exactly one task. + * Copy constructor. Objects of this type can not be copied, and so this + * constructor is `delete`d and can't be called. */ - TaskDescriptor(const TaskDescriptor &); + TaskDescriptor(const TaskDescriptor &) = delete; /** * Destructor. @@ -1305,11 +1305,11 @@ namespace Threads ~TaskDescriptor(); /** - * Copy operator. Throws an exception since we want to make sure that - * each TaskDescriptor object corresponds to exactly one task. + * Copy operator. Objects of this type can not be copied, and so this + * operator is `delete`d and can't be called. */ TaskDescriptor & - operator=(const TaskDescriptor &); + operator=(const TaskDescriptor &) = delete; /** * Queue up the task to the scheduler. We need to do this in a separate @@ -1371,17 +1371,6 @@ namespace Threads - template - TaskDescriptor::TaskDescriptor(const TaskDescriptor &) - : task_is_done(false) - { - // we shouldn't be getting here -- task descriptors - // can't be copied - Assert(false, ExcInternalError()); - } - - - template inline TaskDescriptor::~TaskDescriptor() { @@ -1404,17 +1393,6 @@ namespace Threads } - template - TaskDescriptor & - TaskDescriptor::operator=(const TaskDescriptor &) - { - // we shouldn't be getting here -- task descriptors - // can't be copied - Assert(false, ExcInternalError()); - return *this; - } - - template inline void TaskDescriptor::join() -- 2.39.5