Commit fcc6632d authored by Praetorius, Simon's avatar Praetorius, Simon

cleanup max and min in Math

parent 991acbfc
Pipeline #4509 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