summaryrefslogtreecommitdiffhomepage
path: root/compat/math.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-10-05 15:59:58 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-10-05 14:35:44 +0000
commit9cca4ffd9987352e43119d9c4dea0ce84c2c448f (patch)
tree250e8092af1738ce51c268e2866dd75d67e879df /compat/math.hpp
parentf0216a3c53d43918295f1bd81975b391f4e5ed3b (diff)
silly busywork
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>