Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supply same uint types overloads or templates #83

Open
WildRackoon opened this issue Oct 12, 2023 · 0 comments
Open

Supply same uint types overloads or templates #83

WildRackoon opened this issue Oct 12, 2023 · 0 comments
Assignees

Comments

@WildRackoon
Copy link

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 Forceflow self-assigned this Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants