From: Wolfgang Bangerth Date: Thu, 6 Aug 2020 22:58:06 +0000 (-0600) Subject: Avoid a couple of places where we explicitly use 'new'. X-Git-Tag: v9.3.0-rc1~1209^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fae524b6bf89da7a50348789890512c45f235f71;p=dealii.git Avoid a couple of places where we explicitly use 'new'. --- 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);