]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Prefer std::make_shared() over operator new(). 5164/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 27 Sep 2017 16:57:05 +0000 (10:57 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 27 Sep 2017 16:57:05 +0000 (10:57 -0600)
source/dofs/dof_tools_constraints.cc

index 4b09056159568ebae7c084e3ae1fa9320c2a368f..67a74aef7e082c79179eac37c63004926ec8fc4a 100644 (file)
@@ -313,7 +313,7 @@ namespace DoFTools
       {
         if (master_dof_mask == nullptr)
           {
-            master_dof_mask.reset (new std::vector<bool> (fe1.dofs_per_face));
+            master_dof_mask = std::make_shared<std::vector<bool> > (fe1.dofs_per_face);
             select_master_dofs_for_face_restriction (fe1,
                                                      fe2,
                                                      face_interpolation_matrix,
@@ -337,8 +337,8 @@ namespace DoFTools
       {
         if (matrix == nullptr)
           {
-            matrix.reset (new FullMatrix<double> (fe2.dofs_per_face,
-                                                  fe1.dofs_per_face));
+            matrix = std::make_shared<FullMatrix<double> > (fe2.dofs_per_face,
+                                                            fe1.dofs_per_face);
             fe1.get_face_interpolation_matrix (fe2,
                                                *matrix);
           }
@@ -358,8 +358,8 @@ namespace DoFTools
       {
         if (matrix == nullptr)
           {
-            matrix.reset (new FullMatrix<double> (fe2.dofs_per_face,
-                                                  fe1.dofs_per_face));
+            matrix = std::make_shared<FullMatrix<double> > (fe2.dofs_per_face,
+                                                            fe1.dofs_per_face);
             fe1.get_subface_interpolation_matrix (fe2,
                                                   subface,
                                                   *matrix);
@@ -385,7 +385,7 @@ namespace DoFTools
 
         if (split_matrix == nullptr)
           {
-            split_matrix.reset (new std::pair<FullMatrix<double>,FullMatrix<double> >());
+            split_matrix = std::make_shared<std::pair<FullMatrix<double>,FullMatrix<double> > >();
 
             const unsigned int n_master_dofs = face_interpolation_matrix.n();
             const unsigned int n_dofs        = face_interpolation_matrix.m();

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.