]> https://gitweb.dealii.org/ - dealii.git/commitdiff
step-7: Use const auto &cell instead of const auto cell
authorMatthias Maier <tamiko@43-1.org>
Wed, 19 Sep 2018 19:02:42 +0000 (14:02 -0500)
committerMatthias Maier <tamiko@43-1.org>
Wed, 19 Sep 2018 19:03:23 +0000 (14:03 -0500)
examples/step-7/step-7.cc

index 38a9c11d948adff1ab21862a62efad6f06dd9fe9..570892df2575487a84e0deaffc39665541746217 100644 (file)
@@ -629,7 +629,7 @@ namespace Step7
 
     // Now for the main loop over all cells. This is mostly unchanged from
     // previous examples, so we only comment on the things that have changed.
-    for (const auto cell : dof_handler.active_cell_iterators())
+    for (const auto &cell : dof_handler.active_cell_iterators())
       {
         cell_matrix = 0.;
         cell_rhs    = 0.;
@@ -997,7 +997,7 @@ namespace Step7
             GridGenerator::hyper_cube(triangulation, -1, 1);
             triangulation.refine_global(3);
 
-            for (const auto cell : triangulation.cell_iterators())
+            for (const auto &cell : triangulation.cell_iterators())
               for (unsigned int face_number = 0;
                    face_number < GeometryInfo<dim>::faces_per_cell;
                    ++face_number)

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.