Commit 1f3895e9 authored by Praetorius, Simon's avatar Praetorius, Simon

Merge branch 'issue/math_max_min' into 'master'

cleanup max and min in Math

See merge request !192
parents 47282811 fcc6632d
Pipeline #4513 failed with stage
in 14 seconds
......@@ -43,8 +43,8 @@ namespace AMDiS
template <class T0, class T1>
constexpr auto min(T0 a, T1 b)
{
using T = std::conditional_t<(sizeof(T0)>sizeof(T1)),T0,T1>;
return a < b ? T(a) : T(b);
using T = std::common_type_t<T0,T1>;
return T(a) < T(b) ? a : b;
}
template <class T0>
......@@ -69,8 +69,8 @@ namespace AMDiS
template <class T0, class T1>
constexpr auto max(T0 a, T1 b)
{
using T = std::conditional_t<(sizeof(T0)>sizeof(T1)),T0,T1>;
return a < b ? T(b) : T(a);
using T = std::common_type_t<T0,T1>;
return T(a) < T(b) ? b : a;
}
template <class T0>
......
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