Use unique_ptr rather than shared_ptr.

This commit is contained in:
Atgeirr Flø Rasmussen 2020-06-19 16:03:46 +02:00
parent 226697ec6f
commit fb99dd6fee

View File

@ -61,13 +61,13 @@ namespace Amg
: linsolver_()
{
assert(op.category() == Dune::SolverCategory::overlapping);
linsolver_.reset(new Solver(op.getmat(), comm, prm, std::function<X()>()));
linsolver_ = std::make_unique<Solver>(op.getmat(), comm, prm, std::function<X()>());
}
PressureInverseOperator(Operator& op, const boost::property_tree::ptree& prm, const SequentialInformation&)
: linsolver_()
{
assert(op.category() != Dune::SolverCategory::overlapping);
linsolver_.reset(new Solver(op.getmat(), prm, std::function<X()>()));
linsolver_ = std::make_unique<Solver>(op.getmat(), prm, std::function<X()>());
}
@ -92,7 +92,7 @@ namespace Amg
}
private:
std::shared_ptr<Solver> linsolver_;
std::unique_ptr<Solver> linsolver_;
};
public: