Skip to content
Snippets Groups Projects
Commit fe05ae05 authored by Patrick M. Jensen's avatar Patrick M. Jensen
Browse files

Add util const an function for minus inf.

parent 5bb31c73
No related branches found
No related tags found
No related merge requests found
......@@ -45,4 +45,17 @@ constexpr std::enable_if_t<!std::is_floating_point<Ty>::value, Ty> infOrMaxF() {
template <class Ty>
constexpr Ty infOrMax = infOrMaxF<Ty>();
template <class Ty>
constexpr std::enable_if_t<std::is_floating_point<Ty>::value, Ty> minusInfOrMinF() {
return -std::numeric_limits<Ty>::infinity();
}
template <class Ty>
constexpr std::enable_if_t<!std::is_floating_point<Ty>::value, Ty> minusInfOrMinF() {
return std::numeric_limits<Ty>::min();
}
template <class Ty>
constexpr Ty minusInfOrMin = minusInfOrMinF<Ty>();
#endif // UTIL_H__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment