Fix abs placement in utility

This commit is contained in:
rexy712 2022-06-11 08:49:04 -07:00
parent 35b64db13c
commit 6f07577bf0

View File

@ -86,6 +86,10 @@ namespace rexy{
{ {
return cmp(l, r) ? l : r; return cmp(l, r) ? l : r;
} }
template<class T>
constexpr T abs(const T& val){
return val > 0 ? val : -val;
}
#ifdef __cpp_lib_is_constant_evaluated #ifdef __cpp_lib_is_constant_evaluated
template<class T> template<class T>
@ -145,10 +149,6 @@ namespace rexy{
ld[i] = rd[i]; ld[i] = rd[i];
} }
} }
template<class T>
constexpr T abs(const T& val){
return val > 0 ? val : -val;
}
} }
#endif //__cpp_lib_is_constant_evaluated #endif //__cpp_lib_is_constant_evaluated