From 4caa640c3b5e899856e2463a2d6b55bec2383f7e Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 24 Jul 2024 15:11:24 -0600 Subject: [PATCH] Add C++20 requirement clauses. --- include/deal.II/base/task_result.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/deal.II/base/task_result.h b/include/deal.II/base/task_result.h index f2883f0f38..b0a1ecb357 100644 --- a/include/deal.II/base/task_result.h +++ b/include/deal.II/base/task_result.h @@ -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 &&other) noexcept; + TaskResult(TaskResult &&other) noexcept DEAL_II_CXX20_REQUIRES( + std::is_move_constructible_v &&std::is_move_assignable_v); /** * 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 &&std::is_move_assignable_v); /** * Copy assignment operator from a Task object. By assigning the Task @@ -395,6 +397,8 @@ namespace Threads template inline TaskResult::TaskResult(TaskResult &&other) noexcept + DEAL_II_CXX20_REQUIRES( + std::is_move_constructible_v &&std::is_move_assignable_v) { // 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 inline TaskResult & TaskResult::operator=(TaskResult &&other) noexcept + DEAL_II_CXX20_REQUIRES( + std::is_move_constructible_v &&std::is_move_assignable_v) { // First clear the current object before we put new content into it: clear(); -- 2.39.5