]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add C++20 requirement clauses.
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 24 Jul 2024 21:11:24 +0000 (15:11 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 19 Aug 2024 17:22:47 +0000 (11:22 -0600)
include/deal.II/base/task_result.h

index f2883f0f38be683d825b9e173e6ce6cd477c54c5..b0a1ecb3570365a1d21deeb1f45fa48ca8d493c2 100644 (file)
@@ -121,7 +121,8 @@ namespace Threads
      * represents the task's result, whereas the old object no longer
      * represents anything and is left as if default-constructed.
      */
-    TaskResult(TaskResult<T> &&other) noexcept;
+    TaskResult(TaskResult<T> &&other) noexcept DEAL_II_CXX20_REQUIRES(
+      std::is_move_constructible_v<T> &&std::is_move_assignable_v<T>);
 
     /**
      * Destructor. If the current object was associated with a task,
@@ -196,7 +197,8 @@ namespace Threads
      * represents anything and is left as if default-constructed.
      */
     TaskResult &
-    operator=(TaskResult &&other) noexcept;
+    operator=(TaskResult &&other) noexcept DEAL_II_CXX20_REQUIRES(
+      std::is_move_constructible_v<T> &&std::is_move_assignable_v<T>);
 
     /**
      * Copy assignment operator from a Task object. By assigning the Task
@@ -395,6 +397,8 @@ namespace Threads
 
   template <typename T>
   inline TaskResult<T>::TaskResult(TaskResult<T> &&other) noexcept
+    DEAL_II_CXX20_REQUIRES(
+      std::is_move_constructible_v<T> &&std::is_move_assignable_v<T>)
   {
     // First lock the other object, then move the members of the other
     // object and reset it. Note that we do not have to wait for
@@ -445,6 +449,8 @@ namespace Threads
   template <typename T>
   inline TaskResult<T> &
   TaskResult<T>::operator=(TaskResult<T> &&other) noexcept
+    DEAL_II_CXX20_REQUIRES(
+      std::is_move_constructible_v<T> &&std::is_move_assignable_v<T>)
   {
     // First clear the current object before we put new content into it:
     clear();

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.