1#ifndef __DUNE_ACFEM_EXPRESSIONS_RUNTIMEEQUAL_HH__
2#define __DUNE_ACFEM_EXPRESSIONS_RUNTIMEEQUAL_HH__
9#include "../common/literals.hh"
31 template<
class T,
class SFINAE =
void>
36 template<
class T,
class SFINAE =
void>
37 struct IsBasicRuntimeEqual
42 struct IsBasicRuntimeEqual<
44 std::enable_if_t<(!IsSubExpressionExpression<T>::value
45 && (IsTypedValue<T>::value
46 || IsIndeterminateExpression<T>::value
47 || HasTag<T, RuntimeEqualExpression>::value)
54 template<std::
size_t ArgIdx,
class T,
class SFINAE =
void>
55 struct IsRTEqualOperand
59 template<std::
size_t ArgIdx,
class T>
60 struct IsRTEqualOperand<
63 std::enable_if_t<IsRuntimeEqual<std::enable_if_t<!IsSelfExpression<T>::value, Operand<ArgIdx, T> > >::value>
68 template<
class T,
class Seq,
class SFINAE =
void>
69 struct HasRTEqualOperands
73 template<
class T, std::size_t... ArgIdx>
74 struct HasRTEqualOperands<
77 std::enable_if_t<AccumulateSequence<LogicalAndFunctor, BoolSequence<IsRTEqualOperand<ArgIdx, T>::value...> >::value>
84 struct IsRuntimeEqual<T,
std::enable_if_t<IsBasicRuntimeEqual<T>::value> >
89 struct IsRuntimeEqual<
91 std::enable_if_t<(!IsBasicRuntimeEqual<T>::value
92 && IsExpression<T>::value
93 && !IsDynamicOperation<Operation<T> >::value
94 && HasRTEqualOperands<T, MakeIndexSequence<Arity<T>::value> >::value
100 template<
class T1,
class T2,
class SFINAE =
void>
102 : std::is_same<DecayExpression<T1>, DecayExpression<T2> >
108 template<
class T1,
class T2>
111 std::enable_if_t<(!IsSubExpressionExpression<T1>::value
112 && !IsSubExpressionExpression<T2>::value
113 && (!IsRuntimeEqual<T2>::value || !IsRuntimeEqual<T1>::value)
122 struct IsBasicRuntimeEqual<
124 std::enable_if_t<IsSubExpressionExpression<T>::value> >
125 : IsRuntimeEqual<Operand<1, T> >
129 template<
class T1,
class T2>
132 std::enable_if_t<(IsSubExpressionExpression<T1>::value
134 IsSubExpressionExpression<T2>::value)> >
138 template<
class T1,
class T2>
141 std::enable_if_t<(IsSubExpressionExpression<T1>::value
143 !IsSubExpressionExpression<T2>::value)> >
147 template<
class T1,
class T2>
148 struct AreRuntimeEqual<
150 std::enable_if_t<(!IsSubExpressionExpression<T1>::value
152 IsSubExpressionExpression<T2>::value)> >
153 : AreRuntimeEqual<T1, Operand<1, T2> >
167 template<
class T1,
class T2>
171 constexpr bool isRuntimeEqualExpression(T&& = T{})
173 return IsRuntimeEqualExpression<T>::value;
176 template<
class T1,
class T2>
177 constexpr bool areRuntimeEqualExpressions(T1&& = T1{}, T2&& = T2{})
179 return AreRuntimeSameExpressions<T1, T2>::value;
Sequence< std::size_t, V... > IndexSequence
Sequence of std::size_t values.
Definition: types.hh:64
BoolConstant< false > FalseType
Alias for std::false_type.
Definition: types.hh:110
BoolConstant< true > TrueType
Alias for std::true_type.
Definition: types.hh:107
Expressions::IsRuntimeEqual< T > IsRuntimeEqualExpression
Definition: runtimeequal.hh:164
FalseType by default.
Definition: runtimeequal.hh:103