From fae524b6bf89da7a50348789890512c45f235f71 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 6 Aug 2020 16:58:06 -0600 Subject: [PATCH] Avoid a couple of places where we explicitly use 'new'. --- .../deal.II/lac/la_parallel_vector.templates.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index 6efd9a5a78..e916e86fcd 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -486,11 +486,8 @@ namespace LinearAlgebra const MPI_Comm communicator) { // set up parallel partitioner with index sets and communicator - std::shared_ptr new_partitioner( - new Utilities::MPI::Partitioner(locally_owned_indices, - ghost_indices, - communicator)); - reinit(new_partitioner); + reinit(std::make_shared( + locally_owned_indices, ghost_indices, communicator)); } @@ -502,9 +499,9 @@ namespace LinearAlgebra const MPI_Comm communicator) { // set up parallel partitioner with index sets and communicator - std::shared_ptr new_partitioner( - new Utilities::MPI::Partitioner(locally_owned_indices, communicator)); - reinit(new_partitioner); + reinit( + std::make_shared(locally_owned_indices, + communicator)); } @@ -523,7 +520,7 @@ namespace LinearAlgebra resize_val(new_allocated_size); // initialize to zero - this->operator=(Number()); + *this = Number(); // do not reallocate import_data directly, but only upon request. It @@ -540,7 +537,7 @@ namespace LinearAlgebra template Vector::Vector() - : partitioner(new Utilities::MPI::Partitioner()) + : partitioner(std::make_shared()) , allocated_size(0) { reinit(0); -- 2.39.5