From: Wolfgang Bangerth Date: Wed, 24 Jul 2024 21:11:24 +0000 (-0600) Subject: Add C++20 requirement clauses. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4caa640c3b5e899856e2463a2d6b55bec2383f7e;p=dealii.git Add C++20 requirement clauses. --- 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();