summaryrefslogtreecommitdiffhomepage
path: root/compat/math.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'compat/math.hpp')
-rw-r--r--compat/math.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/compat/math.hpp b/compat/math.hpp
index eae1435e..04a6e08d 100644
--- a/compat/math.hpp
+++ b/compat/math.hpp
@@ -53,10 +53,10 @@ inline auto clamp(const t& val, const u& min, const w& max)
return ::util_detail::clamp<std::decay_t<tp>, tp>::clamp_(val, min, max);
}
-template<typename t>
-inline auto iround(t val) -> std::enable_if_t<!std::is_integral_v<std::decay_t<t>>, t>
+template<typename t, typename integral_type = int>
+inline auto iround(t val) -> std::enable_if_t<!std::is_integral_v<std::decay_t<t>>, integral_type>
{
- return (int) std::round(val);
+ return static_cast<integral_type>(std::round(val));
}
template<typename t>