]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Replace use of C-style array by std::array.
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 8 Jul 2023 06:21:13 +0000 (00:21 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 8 Jul 2023 06:21:13 +0000 (00:21 -0600)
include/deal.II/numerics/vector_tools_constraints.templates.h

index 235392d05def0c806dba6cd3dc7151addeb7d471..3fa96e5a782c1be949bb0cd98cb22ddaf2c2b2b7 100644 (file)
@@ -38,7 +38,7 @@ namespace VectorTools
     template <int dim>
     struct VectorDoFTuple
     {
-      types::global_dof_index dof_indices[dim];
+      std::array<types::global_dof_index, dim> dof_indices;
 
       VectorDoFTuple()
       {
@@ -50,28 +50,19 @@ namespace VectorTools
       bool
       operator<(const VectorDoFTuple<dim> &other) const
       {
-        for (unsigned int i = 0; i < dim; ++i)
-          if (dof_indices[i] < other.dof_indices[i])
-            return true;
-          else if (dof_indices[i] > other.dof_indices[i])
-            return false;
-        return false;
+        return (dof_indices < other.dof_indices);
       }
 
       bool
       operator==(const VectorDoFTuple<dim> &other) const
       {
-        for (unsigned int i = 0; i < dim; ++i)
-          if (dof_indices[i] != other.dof_indices[i])
-            return false;
-
-        return true;
+        return (dof_indices == other.dof_indices);
       }
 
       bool
       operator!=(const VectorDoFTuple<dim> &other) const
       {
-        return !(*this == other);
+        return (dof_indices != other.dof_indices);
       }
     };
 

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.