]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Address clang-tidy suggestions 6927/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 17 Jul 2018 23:07:01 +0000 (01:07 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 18 Jul 2018 12:13:35 +0000 (14:13 +0200)
include/deal.II/numerics/data_out_dof_data.templates.h
source/grid/grid_generator.cc
tests/quick_tests/sundials-ida.cc

index b32440a6135ab9b4577857816aa3d7d2d04a72ad..8f492389d79140eda8c095d5a7b773bb6542f026 100644 (file)
@@ -1389,7 +1389,7 @@ DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::
               }
 
           // finally add a corresponding range
-          ranges.push_back(std::make_tuple(
+          ranges.emplace_back(std::forward_as_tuple(
             output_component,
             output_component + patch_space_dim - 1,
             name,
@@ -1428,7 +1428,7 @@ DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::
               }
 
           // finally add a corresponding range
-          ranges.push_back(std::make_tuple(
+          ranges.emplace_back(std::forward_as_tuple(
             output_component,
             output_component + size - 1,
             name,
index 2ed25d76b79f0cd0e5ec0485fa228ccefb035844..4181dc1a7ec24bc291e3c5f5665982df6b234650 100644 (file)
@@ -1983,7 +1983,7 @@ namespace GridGenerator
 
       auto min_line_length = [](const Triangulation<2> &tria) -> double {
         double length = std::numeric_limits<double>::max();
-        for (const auto cell : tria.active_cell_iterators())
+        for (const auto &cell : tria.active_cell_iterators())
           for (unsigned int n = 0; n < GeometryInfo<2>::lines_per_cell; ++n)
             length = std::min(length, cell->line(n)->diameter());
         return length;
@@ -4214,7 +4214,7 @@ namespace GridGenerator
                             line->vertex_index(1) + offset;
                           boundary_line.manifold_id = line->manifold_id();
                           subcell_data.boundary_lines.push_back(
-                            std::move(boundary_line));
+                            boundary_line); // trivially-copyable
                         }
                   };
 
@@ -4257,7 +4257,7 @@ namespace GridGenerator
 
                           boundary_quad.manifold_id = face->manifold_id();
                           subcell_data.boundary_quads.push_back(
-                            std::move(boundary_quad));
+                            boundary_quad); // trivially-copyable
                         }
                     for (const auto &cell : tria.cell_iterators())
                       for (unsigned int l = 0; l < 12; ++l)
@@ -4272,7 +4272,7 @@ namespace GridGenerator
                             boundary_line.manifold_id =
                               cell->line(l)->manifold_id();
                             subcell_data.boundary_lines.push_back(
-                              std::move(boundary_line));
+                              boundary_line); // trivially_copyable
                           }
                   };
 
index 38d9878a3d997ec45d8695fb0f532be4792d3ecf..2148c78ed7f88c73caff6275683f6a61c58d32d0 100644 (file)
@@ -72,7 +72,7 @@ public:
     time_stepper.reinit_vector = [&](Vector<double> &v) { v.reinit(2); };
 
 
-    typedef Vector<double> VectorType;
+    using VectorType = Vector<double>;
 
     time_stepper.residual = [&](const double /*t*/,
                                 const VectorType &y,

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.