Skip to content
Snippets Groups Projects
Commit 7a49fd03 authored by Tristan Walter's avatar Tristan Walter
Browse files

infinity for integral types is now just the MAX

parent dacbe9b0
No related branches found
No related tags found
No related merge requests found
...@@ -301,6 +301,13 @@ inline constexpr auto infinity() ...@@ -301,6 +301,13 @@ inline constexpr auto infinity()
return std::numeric_limits<T>::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) { inline uint64_t next_pow2(uint64_t x) {
return x == 1 ? 1 : 1<<(64-__builtin_clzl(x-1)); return x == 1 ? 1 : 1<<(64-__builtin_clzl(x-1));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment