maths: only enable util::limit for scalar types

this reduces conflicts with the coord limit operation.
This commit is contained in:
Danny Robson 2017-08-24 12:26:36 +10:00
parent 1d988608c1
commit d8e4354f22

View File

@ -628,7 +628,10 @@ namespace util {
// min/max clamping
template <typename T, typename U, typename V>
constexpr
T
std::enable_if_t<
std::is_scalar_v<T> && std::is_scalar_v<U> && std::is_scalar_v<V>,
std::common_type_t<T,U,V>
>
limit (const T val, const U lo, const V hi)
{
assert (lo <= hi);