]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use std::pair for tuples of two elements. 18578/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 24 Jun 2025 22:23:28 +0000 (16:23 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 24 Jun 2025 22:23:40 +0000 (16:23 -0600)
source/base/mpi_remote_point_evaluation.cc

index 23bbac677da74df4445320e621473e2b7ae5160b..4ceae1f88c0aa8c45d4a290ddf4f4f48564b772e 100644 (file)
@@ -166,9 +166,9 @@ namespace Utilities
           this->point_ptrs[std::get<1>(data.recv_components[i]) + 1]++;
         }
 
-      std::tuple<unsigned int, unsigned int> n_owning_processes_default{
+      std::pair<unsigned int, unsigned int> n_owning_processes_default{
         numbers::invalid_unsigned_int, 0};
-      std::tuple<unsigned int, unsigned int> n_owning_processes_local =
+      std::pair<unsigned int, unsigned int> n_owning_processes_local =
         n_owning_processes_default;
 
       for (unsigned int i = 0; i < data.n_searched_points; ++i)
@@ -184,18 +184,18 @@ namespace Utilities
         }
 
       const auto n_owning_processes_global =
-        Utilities::MPI::all_reduce<std::tuple<unsigned int, unsigned int>>(
+        Utilities::MPI::all_reduce<std::pair<unsigned int, unsigned int>>(
           n_owning_processes_local,
           tria.get_mpi_communicator(),
           [&](const auto &a,
-              const auto &b) -> std::tuple<unsigned int, unsigned int> {
+              const auto &b) -> std::pair<unsigned int, unsigned int> {
             if (a == n_owning_processes_default)
               return b;
 
             if (b == n_owning_processes_default)
               return a;
 
-            return std::tuple<unsigned int, unsigned int>{
+            return std::pair<unsigned int, unsigned int>{
               std::min(std::get<0>(a), std::get<0>(b)),
               std::max(std::get<1>(a), std::get<1>(b))};
           });

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.