]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid a bare 'new' in step-37. 16131/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 13 Oct 2023 17:14:39 +0000 (11:14 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 13 Oct 2023 17:25:21 +0000 (11:25 -0600)
examples/step-37/step-37.cc

index 2b2c089b690826fb2af334cd6fa3fe01c0146892..f428beb6c666a6d5dbe1eb9c9ef74154427134c0 100644 (file)
@@ -862,8 +862,8 @@ namespace Step37
           additional_data.mapping_update_flags =
             (update_gradients | update_JxW_values | update_quadrature_points);
           additional_data.mg_level = level;
-          std::shared_ptr<MatrixFree<dim, float>> mg_mf_storage_level(
-            new MatrixFree<dim, float>());
+          std::shared_ptr<MatrixFree<dim, float>> mg_mf_storage_level =
+            std::make_shared<MatrixFree<dim, float>>();
           mg_mf_storage_level->reinit(mapping,
                                       dof_handler,
                                       level_constraints,

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.