]> https://gitweb.dealii.org/ - dealii.git/commitdiff
parallel::CellWeights: Capture values, not references. 9516/head
authorMarc Fehling <marc.fehling@gmx.net>
Tue, 11 Feb 2020 19:23:34 +0000 (20:23 +0100)
committerMarc Fehling <marc.fehling@gmx.net>
Tue, 11 Feb 2020 19:27:46 +0000 (20:27 +0100)
source/distributed/cell_weights.cc

index 9f78643207ed028660c74d85b90fc6fd18133b1d..2980844f317db83f2d34d8328397ad29bef9244b 100644 (file)
@@ -79,7 +79,7 @@ namespace parallel
   CellWeights<dim, spacedim>::ndofs_weighting(
     const std::pair<float, float> &coefficients)
   {
-    return [&coefficients](
+    return [coefficients](
              const typename hp::DoFHandler<dim, spacedim>::cell_iterator &,
              const FiniteElement<dim, spacedim> &future_fe) -> unsigned int {
       const float result =
@@ -101,7 +101,7 @@ namespace parallel
   CellWeights<dim, spacedim>::ndofs_weighting(
     const std::vector<std::pair<float, float>> &coefficients)
   {
-    return [&coefficients](
+    return [coefficients](
              const typename hp::DoFHandler<dim, spacedim>::cell_iterator &,
              const FiniteElement<dim, spacedim> &future_fe) -> unsigned int {
       float result = 0;
@@ -139,7 +139,7 @@ namespace parallel
       ExcMessage(
         "parallel::CellWeights requires a parallel::TriangulationBase object."));
 
-    return [&dof_handler, tria, &weighting_function](
+    return [&dof_handler, tria, weighting_function](
              const typename Triangulation<dim, spacedim>::cell_iterator &cell,
              const typename Triangulation<dim, spacedim>::CellStatus     status)
              -> unsigned int {

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.