Commit 3ff5756b authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Remove check for class template argument deduction

parent bf6a91cb
...@@ -180,7 +180,7 @@ namespace AMDiS ...@@ -180,7 +180,7 @@ namespace AMDiS
}; };
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION // deduction guides
template <class RB, class CB> template <class RB, class CB>
BiLinearForm(RB&&, CB&&) BiLinearForm(RB&&, CB&&)
-> BiLinearForm<Underlying_t<RB>, Underlying_t<CB>>; -> BiLinearForm<Underlying_t<RB>, Underlying_t<CB>>;
...@@ -188,7 +188,7 @@ namespace AMDiS ...@@ -188,7 +188,7 @@ namespace AMDiS
template <class RB> template <class RB>
BiLinearForm(RB&&) BiLinearForm(RB&&)
-> BiLinearForm<Underlying_t<RB>, Underlying_t<RB>>; -> BiLinearForm<Underlying_t<RB>, Underlying_t<RB>>;
#endif
template <class T = double, class RB, class CB> template <class T = double, class RB, class CB>
auto makeBiLinearForm(RB&& rowBasis, CB&& colBasis) auto makeBiLinearForm(RB&& rowBasis, CB&& colBasis)
......
...@@ -218,11 +218,12 @@ namespace AMDiS ...@@ -218,11 +218,12 @@ namespace AMDiS
std::shared_ptr<GlobalBasis const> basis_; std::shared_ptr<GlobalBasis const> basis_;
}; };
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
// deduction guides
template <class GB> template <class GB>
DOFVector(GB&& basis, DataTransferOperation op = DataTransferOperation::INTERPOLATE) DOFVector(GB&& basis, DataTransferOperation op = DataTransferOperation::INTERPOLATE)
-> DOFVector<ParallelGlobalBasis<typename Underlying_t<GB>::PreBasis>>; -> DOFVector<ParallelGlobalBasis<typename Underlying_t<GB>::PreBasis>>;
#endif
/// \brief Create a DOFVector from a basis. /// \brief Create a DOFVector from a basis.
/** /**
......
...@@ -117,11 +117,11 @@ namespace AMDiS ...@@ -117,11 +117,11 @@ namespace AMDiS
}; };
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION // deduction guide
template <class GB> template <class GB>
LinearForm(GB&& basis) LinearForm(GB&& basis)
-> LinearForm<Underlying_t<GB>>; -> LinearForm<Underlying_t<GB>>;
#endif
template <class T = double, class GB> template <class T = double, class GB>
auto makeLinearForm(GB&& basis) auto makeLinearForm(GB&& basis)
......
...@@ -401,13 +401,12 @@ namespace AMDiS ...@@ -401,13 +401,12 @@ namespace AMDiS
}; };
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
// Deduction guide for GridFunctionMarker class // Deduction guide for GridFunctionMarker class
template <class Grid, class GF> template <class Grid, class GF>
GridFunctionMarker(std::string const& name, std::shared_ptr<Grid> const& grid, GF&& gf) GridFunctionMarker(std::string const& name, std::shared_ptr<Grid> const& grid, GF&& gf)
-> GridFunctionMarker<Grid, -> GridFunctionMarker<Grid,
TYPEOF( makeGridFunction(FWD(gf), grid->leafGridView()) )>; TYPEOF( makeGridFunction(FWD(gf), grid->leafGridView()) )>;
#endif
// Generator function for GridFunctionMarker class // Generator function for GridFunctionMarker class
template <class Grid, class PreGridFct> template <class Grid, class PreGridFct>
......
...@@ -86,8 +86,7 @@ namespace AMDiS ...@@ -86,8 +86,7 @@ namespace AMDiS
}; };
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION // Deduction guides
// Deduction rule
template <class Traits> template <class Traits>
ProblemInstat(std::string const& name, ProblemStat<Traits>& prob) ProblemInstat(std::string const& name, ProblemStat<Traits>& prob)
-> ProblemInstat<Traits>; -> ProblemInstat<Traits>;
...@@ -95,7 +94,7 @@ namespace AMDiS ...@@ -95,7 +94,7 @@ namespace AMDiS
template <class Traits> template <class Traits>
ProblemInstat(std::string const& name, ProblemStat<Traits>& prob, ProblemStatBase& initialProb) ProblemInstat(std::string const& name, ProblemStat<Traits>& prob, ProblemStatBase& initialProb)
-> ProblemInstat<Traits>; -> ProblemInstat<Traits>;
#endif
// Generator for ProblemInstat with given ProblemStat // Generator for ProblemInstat with given ProblemStat
template <class Traits> template <class Traits>
......
...@@ -516,12 +516,11 @@ namespace AMDiS ...@@ -516,12 +516,11 @@ namespace AMDiS
}; };
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION // Deduction guide
// Deduction rule
template <class Grid, class GlobalBasis> template <class Grid, class GlobalBasis>
ProblemStat(std::string const& name, Grid& grid, GlobalBasis& globalBasis) ProblemStat(std::string const& name, Grid& grid, GlobalBasis& globalBasis)
-> ProblemStat<DefaultProblemTraits<GlobalBasis>>; -> ProblemStat<DefaultProblemTraits<GlobalBasis>>;
#endif
// Generator for ProblemStat with given Grid and GlobalBasis // Generator for ProblemStat with given Grid and GlobalBasis
template <class Grid, class GlobalBasis> template <class Grid, class GlobalBasis>
......
...@@ -31,11 +31,12 @@ namespace AMDiS ...@@ -31,11 +31,12 @@ namespace AMDiS
template <class Coeff, class GB, class TreePath = Dune::TypeTree::HybridTreePath<>> template <class Coeff, class GB, class TreePath = Dune::TypeTree::HybridTreePath<>>
class DiscreteFunction; class DiscreteFunction;
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
// deduction guide
template <class Coeff, class GB, class TreePath = RootTreePath> template <class Coeff, class GB, class TreePath = RootTreePath>
DiscreteFunction(Coeff&, GB const&, TreePath = {}) DiscreteFunction(Coeff&, GB const&, TreePath = {})
-> DiscreteFunction<Coeff, GB, TreePath_t<TreePath>>; -> DiscreteFunction<Coeff, GB, TreePath_t<TreePath>>;
#endif
/// A Generator for a mutable \ref DiscreteFunction /// A Generator for a mutable \ref DiscreteFunction
template <class Coeff, class GB, class Path = RootTreePath, template <class Coeff, class GB, class Path = RootTreePath,
......
...@@ -89,10 +89,8 @@ int main(int argc, char** argv) ...@@ -89,10 +89,8 @@ int main(int argc, char** argv)
auto vec4 = makeDOFVector<double>(basis); auto vec4 = makeDOFVector<double>(basis);
test_dofvector(vec4); test_dofvector(vec4);
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
DOFVector vec5(basis); DOFVector vec5(basis);
test_dofvector(vec5); test_dofvector(vec5);
#endif
} }
// test automatic updates // test automatic updates
......
...@@ -62,10 +62,9 @@ int main(int argc, char** argv) ...@@ -62,10 +62,9 @@ int main(int argc, char** argv)
auto const& U_c = *prob.solutionVector(); auto const& U_c = *prob.solutionVector();
auto& U_m = *prob.solutionVector(); auto& U_m = *prob.solutionVector();
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
DiscreteFunction u0_c(U_c.coefficients(), *U_c.basis()); DiscreteFunction u0_c(U_c.coefficients(), *U_c.basis());
DiscreteFunction u0_m(U_m.coefficients(), *U_m.basis()); DiscreteFunction u0_m(U_m.coefficients(), *U_m.basis());
#endif
auto u1_c = makeDiscreteFunction(U_c); auto u1_c = makeDiscreteFunction(U_c);
auto u1_m = makeDiscreteFunction(U_m); auto u1_m = makeDiscreteFunction(U_m);
......
...@@ -38,11 +38,8 @@ int main(int argc, char** argv) ...@@ -38,11 +38,8 @@ int main(int argc, char** argv)
return { 1.0 / (0.1 + std::min(distance(x0, x), distance(x1, x))) }; return { 1.0 / (0.1 + std::min(distance(x0, x), distance(x1, x))) };
}; };
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
GridFunctionMarker marker("mymarker", prob.grid(), markerFunc); GridFunctionMarker marker("mymarker", prob.grid(), markerFunc);
#else auto marker2 = makeGridFunctionMarker("mymarker", prob.grid(), markerFunc);
auto marker = makeGridFunctionMarker("mymarker", prob.grid(), markerFunc);
#endif
prob.addMarker(marker); prob.addMarker(marker);
......
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