1#ifndef __DUNE_ACFEM_COMMON_NAMED_CONSTANT_HH__
2#define __DUNE_ACFEM_COMMON_NAMED_CONSTANT_HH__
20 template<
class T,
char... Name>
24 struct IsNamedConstant
29 struct IsNamedConstant<T&>
30 : IsNamedConstant<std::decay_t<T> >
34 struct IsNamedConstant<T&&>
35 : IsNamedConstant<std::decay_t<T> >
38 template<
class T,
char... Name>
39 struct IsNamedConstant<NamedConstant<T, Name...> >
43 template<
class T,
char... Name>
44 std::string toString(NamedConstant<T, Name...>)
46 using Type = NamedConstant<T, Name...>;
47 const std::string name({ Name... });
48 return name+
":"+ACFem::toString(Type::value);
55 static_assert(
sizeof(T) <
sizeof(0.0L),
"Unsupported floating point precision.");
56 static constexpr T value = (T)2.718281828459045235360287471352662498L;
57 constexpr T operator()()
const
61 constexpr operator T()
const
71 static_assert(
sizeof(T) <
sizeof(0.0L),
"Unsupported floating point precision.");
72 static constexpr T value = (T)1.442695040888963407359924681001892137L;
73 constexpr T operator()()
const
77 constexpr operator T()
const
87 static_assert(
sizeof(T) <
sizeof(0.0L),
"Unsupported floating point precision.");
88 static constexpr T value = (T)0.434294481903251827651128918916605082L;
89 constexpr T operator()()
const
93 constexpr operator T()
const
103 static_assert(
sizeof(T) <
sizeof(0.0L),
"Unsupported floating point precision.");
104 static constexpr T value = (T)0.693147180559945309417232121458176568L;
105 constexpr T operator()()
const
109 constexpr operator T()
const
119 static_assert(
sizeof(T) <
sizeof(0.0L),
"Unsupported floating point precision.");
120 static constexpr T value = (T)2.302585092994045684017991454684364208L;
121 constexpr T operator()()
const
125 constexpr operator T()
const
135 static_assert(
sizeof(T) <
sizeof(0.0L),
"Unsupported floating point precision.");
136 static constexpr T value = (T)3.141592653589793238462643383279502884L;
137 constexpr T operator()()
const
141 constexpr operator T()
const
151 static_assert(
sizeof(T) <
sizeof(0.0L),
"Unsupported floating point precision.");
152 static constexpr T value = (T)1.570796326794896619231321691639751442L;
153 constexpr T operator()()
const
157 constexpr operator T()
const
167 static_assert(
sizeof(T) <
sizeof(0.0L),
"Unsupported floating point precision.");
168 static constexpr T value = (T)0.785398163397448309615660845819875721L;
169 constexpr T operator()()
const
173 constexpr operator T()
const
183 static_assert(
sizeof(T) <
sizeof(0.0L),
"Unsupported floating point precision.");
184 static constexpr T value = (T)0.318309886183790671537767526745028724L;
185 constexpr T operator()()
const
189 constexpr operator T()
const
199 static_assert(
sizeof(T) <
sizeof(0.0L),
"Unsupported floating point precision.");
200 static constexpr T value = (T)0.636619772367581343075535053490057448L;
201 constexpr T operator()()
const
205 constexpr operator T()
const
215 static_assert(
sizeof(T) <
sizeof(0.0L),
"Unsupported floating point precision.");
216 static constexpr T value = (T)1.128379167095512573896158903121545172L;
217 constexpr T operator()()
const
221 constexpr operator T()
const
231 static_assert(
sizeof(T) <
sizeof(0.0L),
"Unsupported floating point precision.");
232 static constexpr T value = (T)1.414213562373095048801688724209698079L;
233 constexpr T operator()()
const
237 constexpr operator T()
const
247 static_assert(
sizeof(T) <
sizeof(0.0L),
"Unsupported floating point precision.");
248 static constexpr T value = (T)0.707106781186547524400844362104849039L;
249 constexpr T operator()()
const
253 constexpr operator T()
const
261 using TypedValue::IsNamedConstant;
BoolConstant< false > FalseType
Alias for std::false_type.
Definition: types.hh:110
BoolConstant< true > TrueType
Alias for std::true_type.
Definition: types.hh:107
A named constant wraps a constant of the given type T tagging it with the given character sequence.
Definition: namedconstant.hh:21