-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Labels
Description
Somewhat related to #41
Having to manage both uint_fast32_t
/ uint_fast16_t
or uint_fast64_t
/ uint_fast32_t
is not easy, especially with templated code:
The following overload:
inline void morton2D_32_decode(const uint_fast32_t morton, uint_fast16_t& x, uint_fast16_t& y);
Should also offer the following overload by casting:
inline void morton2D_32_decode(const uint_fast32_t morton, uint_fast32_t & x, uint_fast32_t & y);
This brings up the fact that it could use a templated implementation to allow that kind of overloads:
template<typename T, typename U>
inline void morton2D_32_decode(const T morton, U& x, U& y);
Implementation should static_assert that both T
and U
are unsigned and optionnaly that there are enough std::numeric_limits<>::digits
between each other.
Forceflow