]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Explicitly disallow copying or moving TaskData objects.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 2 Dec 2021 22:16:05 +0000 (15:16 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sun, 5 Dec 2021 21:38:48 +0000 (14:38 -0700)
include/deal.II/base/thread_management.h

index e5bcc12e0a4e51cc084692617910ddf8ca5bd5b9..265768f35df3b5233e20f9719a2dc4c2f55b78c9 100644 (file)
@@ -1296,6 +1296,31 @@ namespace Threads
         , task_has_finished(false)
       {}
 
+      /**
+       * There can only be one TaskData object referencing
+       * a task. Make sure that these objects are not copied.
+       */
+      TaskData(const TaskData &) = delete;
+
+      /**
+       * There can only be one TaskData object referencing
+       * a task. Make sure that these objects are not moved.
+       */
+      TaskData(TaskData &&) = delete;
+
+      /**
+       * There can only be one TaskData object referencing
+       * a task. Make sure that these objects are not copied.
+       */
+      TaskData &
+      operator=(const TaskData &) = delete;
+
+      /**
+       * There can only be one TaskData object referencing
+       * a task. Make sure that these objects are not moved.
+       */
+      TaskData &
+      operator=(TaskData &&) = delete;
 
       /**
        * Destructor. Wait for the results to be ready. This ensures that the

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.