]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Work around a strange compiler issue.
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 15 Nov 2022 14:47:03 +0000 (07:47 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 15 Nov 2022 14:47:03 +0000 (07:47 -0700)
The MPI build bot complains that using a {...} initializer list would require the use
of a conversion constructor marked as 'explicit':

data_out_base.cc:1156:29: error: converting to ‘std::tuple<unsigned int, unsigned int>’ from initializer list would use explicit constructor ‘constexpr std::tuple<_T1, _T2>::tuple(_U1&&, _U2&&) [with _U1 = unsigned int&; _U2 = unsigned int&; <template-parameter-2-3> = void; _T1 = unsigned int; _T2 = unsigned int]’

That makes no sense, but let's appease the compiler by being explicit.

source/base/data_out_base.cc

index d97b43fe707f5da55bff849f64f0e5f513d8ddbd..a52000ebaa5144a101e285dc1ce2fcccd473d0b7 100644 (file)
@@ -1153,7 +1153,7 @@ namespace
           }
       }
 
-    return {n_nodes, n_cells};
+    return std::tuple<unsigned int, unsigned int>(n_nodes, n_cells);
   }
 
 
@@ -1209,7 +1209,8 @@ namespace
           }
       }
 
-    return {n_nodes, n_cells, n_points_and_n_cells};
+    return std::tuple<unsigned int, unsigned int, unsigned int>(
+      n_nodes, n_cells, n_points_and_n_cells);
   }
 
   /**

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.