From: Wolfgang Bangerth Date: Tue, 21 Apr 2020 15:49:03 +0000 (-0600) Subject: Explicitly =delete copy operators for TaskDescriptor. X-Git-Tag: v9.2.0-rc1~199^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2163b3424b1c9c8f072a69486896c0d625010788;p=dealii.git Explicitly =delete copy operators for TaskDescriptor. --- 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()