Commit d84a4cc7 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Remove ToUniquePtr from recent dune common and grid

parent 30706605
......@@ -10,6 +10,11 @@
#include <dune/common/hybridutilities.hh>
#include <dune/common/timer.hh>
#if DUNE_VERSION_EQUAL(DUNE_COMMON,2,7)
#include <dune/common/to_unique_ptr.hh>
#endif
#include <dune/common/version.hh>
#include <dune/common/parallel/mpihelper.hh>
......@@ -469,12 +474,18 @@ namespace Dune
std::unique_ptr<HostGrid> hostGrid(hostFactory_.createGrid());
return new GridType(std::move(hostGrid));
}
#else
#elif DUNE_VERSION_LT(DUNE_GRID,2,8)
ToUniquePtr<GridType> createGrid() override
{
std::unique_ptr<HostGrid> hostGrid(hostFactory_.createGrid());
return makeToUnique<GridType>(std::move(hostGrid));
}
#else
std::unique_ptr<GridType> createGrid() override
{
std::unique_ptr<HostGrid> hostGrid(hostFactory_.createGrid());
return std::make_unique<GridType>(std::move(hostGrid));
}
#endif
private:
......
......@@ -7,6 +7,9 @@
#if ! DUNE_VERSION_GT(DUNE_GRID,2,6)
#include <dune/grid/yaspgrid.hh>
#endif
#if DUNE_VERSION_EQUAL(DUNE_COMMON,2,7)
#include <dune/common/to_unique_ptr.hh>
#endif
namespace Dune
{
......@@ -83,10 +86,12 @@ namespace Dune
using Super::insertBoundarySegment;
/// \brief Finalize grid creation and hand over the grid
#if DUNE_VERSION_GT(DUNE_GRID,2,6)
#if DUNE_VERSION_LT(DUNE_GRID,2,7)
GridType* createGrid () override
#elif DUNE_VERSION_LT(DUNE_GRID,2,8)
ToUniquePtr<GridType> createGrid () override
#else
GridType* createGrid () override
std::unique_ptr<GridType> createGrid () override
#endif
{
return factory_->createGrid();
......
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