diff --git a/Application/src/commons/common/misc/math.h b/Application/src/commons/common/misc/math.h index e63d55e37b3082fd0e99117c79e34c9bef311cb4..8f8657a38a32e51c289da4fbbe9760e61fd8ff3f 100644 --- a/Application/src/commons/common/misc/math.h +++ b/Application/src/commons/common/misc/math.h @@ -301,6 +301,13 @@ inline constexpr auto infinity() return std::numeric_limits<T>::infinity(); } +template<typename T> +inline constexpr auto infinity() + -> typename std::enable_if<std::is_integral<T>::value, T>::type +{ + return std::numeric_limits<T>::max(); +} + inline uint64_t next_pow2(uint64_t x) { return x == 1 ? 1 : 1<<(64-__builtin_clzl(x-1)); }