-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
Prefer bitsize variant over standard integral types #128
Prefer bitsize variant over standard integral types #128
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much!
Thank you for thinking about this. I think it's fine to rely on the availability. For now, we do support the platforms and compilers that are tested in CI (GCC, Clang, MSVC). If someone wants to add support for additional platforms or compilers, we can re-evaluate this. |
Another behaviour to note, even though the associations are registered, type names deduced from int var{};
dbg(var); // var = 0 (int32_t)
int arr1[3]{};
dbg(arr1); // arr1 = {0, 0, 0} (int [3])
std::array<int, 3> arr2{};
dbg(arr2); // arr2 = {0, 0, 0} (std::array<int, 3>)
std::array<std::pair<int, int>, 3> arr3{};
dbg(arr3); // arr3 = {{0, 0}, {0, 0}, {0, 0}} (std::array<std::pair<int, int>, 3>)
dbg(arr3[0]); // arr3[0] = {0, 0} (std::pair<int32_t, int32_t>&) I am not sure how to fix this apart from specialising |
Thank you. This looks (almost) good to go. Can you please remove the
Hm. Adding a specialization for C-style arrays and |
1605f94
to
e7594a0
Compare
- Specializations for `std::array` and C-style array declarations
e7594a0
to
cf4ad54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the update!
Love this project! Taught me a lot 😄 |
Fixes #69
Have adapted some tests, replaced some types in const, pointer tests to keep code clean.
Note : Although the CI checks are all passing, the standard does not mandate fixed width integer types to be available. Though very rare, there might be cases when these are undefined (embedded applications is what I can think of). I am not sure if if this project in intended to support such applications. If that is the case we could wrap each association with a feature test macro. Something like
Or if you have any other elegant suggestions please let me know!