Commit 98236bb3 authored by Martin Nolte's avatar Martin Nolte

Merge branch 'feature/tensorgridfactory-return-unique_ptr' into 'master'

TensorGridFactory: return `unique_ptr` instead of `shared_ptr`

See merge request !241

(cherry picked from commit 73c827b3)

2c7791e6 TensorGridFactory: return `unique_ptr` instead of `shared_ptr`
parent a483815f
Pipeline #5886 passed with stage
in 80 minutes and 53 seconds
......@@ -43,7 +43,7 @@ namespace Dune
typedef typename Grid::ctype ctype;
static const int dim = Grid::dimension;
std::shared_ptr<Grid> createGrid(Comm comm = Comm())
std::unique_ptr<Grid> createGrid(Comm comm = Comm())
{
TensorGridFactoryCreator<Grid> creator(*this);
return creator.createGrid(comm);
......@@ -309,7 +309,7 @@ namespace Dune
TensorGridFactoryCreator(const TensorGridFactory<Grid>& factory) : _factory(factory) {}
std::shared_ptr<Grid> createGrid(Comm comm)
std::unique_ptr<Grid> createGrid(Comm comm)
{
// The grid factory
GridFactory<Grid> fac;
......@@ -375,7 +375,7 @@ namespace Dune
}
}
return std::shared_ptr<Grid>(fac.createGrid());
return std::unique_ptr<Grid>(fac.createGrid());
}
private:
......@@ -391,9 +391,9 @@ namespace Dune
TensorGridFactoryCreator(const TensorGridFactory<Grid>& factory) : _factory(factory) {}
std::shared_ptr<Grid> createGrid(Comm comm)
std::unique_ptr<Grid> createGrid(Comm comm)
{
return std::make_shared<Grid>(_factory.coords(), std::bitset<dim>(0ULL), 1, comm);
return std::make_unique<Grid>(_factory.coords(), std::bitset<dim>(0ULL), 1, comm);
}
private:
const TensorGridFactory<Grid>& _factory;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment