diff --git a/dune/solvers/common/algorithm.hh b/dune/solvers/common/algorithm.hh index f9772781ca6d287f5d11b7f98fe9cf1afd0c08c3..4d20b2f58c104d5ce9c822cb1ae463b52734a80e 100644 --- a/dune/solvers/common/algorithm.hh +++ b/dune/solvers/common/algorithm.hh @@ -5,6 +5,8 @@ #include <dune/common/typeutilities.hh> +#include <dune/common/typetraits.hh> + #include <dune/istl/multitypeblockvector.hh> @@ -34,24 +36,6 @@ struct StaticForLoop<ST, end, end> {} }; -// Check if T is an integral constant -template<class T> -struct IsIntegralConstantHelper -{ - static const bool value = false; -}; - -template<class T, T t> -struct IsIntegralConstantHelper<std::integral_constant<T, t>> -{ - static const bool value = true; -}; - -// Check if T is an integral constant -template<class T> -struct IsIntegralConstant : public IsIntegralConstantHelper<std::decay_t<T>> -{}; - // Compute t1==t2 either statically or dynamically @@ -105,7 +89,7 @@ void staticIf(IfFunc&& ifFunc, ElseFunc&& elseFunc, std::true_type) * is the static index. */ template<class Index, class Begin, class End, class F, class... Args, - std::enable_if_t<Imp::IsIntegralConstant<Begin>::value and Imp::IsIntegralConstant<End>::value, int> = 0> + std::enable_if_t<IsIntegralConstant<Begin>::value and IsIntegralConstant<End>::value, int> = 0> void integralRangeFor(Begin&& begin, End&& end, F&& f, Args&&... args) { static const Index begin_t = begin; @@ -136,7 +120,7 @@ void integralRangeFor(Begin&& begin, End&& end, F&& f, Args&&... args) * body is called with indices of type Index. */ template<class Index, class Begin, class End, class F, class... Args, - std::enable_if_t<not(Imp::IsIntegralConstant<Begin>::value and Imp::IsIntegralConstant<End>::value), int> = 0> + std::enable_if_t<not(IsIntegralConstant<Begin>::value and IsIntegralConstant<End>::value), int> = 0> void integralRangeFor(Begin&& begin, End&& end, F&& f, Args&&... args) { for(Index i=begin; i != end; ++i)