Skip to content
Snippets Groups Projects
Commit fbc8be30 authored by Carsten Gräser's avatar Carsten Gräser
Browse files

Use type traits from dune-common

parent 4d7994b8
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -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)
......
  • Contributor

    Seit diesem commit mögen die Buildbots dune-solvers nicht mehr.

    Ich nehme an, ihre dune-common clones sind einfach veraltet, sodass der dune-common-commit 396ed98afafb43b1b9e8972dd9b60d8170d4a56b fehlt.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment