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

Bug: Fails to compile when size_t is not the same size as unsigned long long #40

Open
ZigaSajovic opened this issue Nov 5, 2020 · 0 comments

Comments

@ZigaSajovic
Copy link

ZigaSajovic commented Nov 5, 2020

In the implementation size_t is used. But the implementation of flat_maprequires this type to be the same size as unsigned long long. But this is not true on all platforms (e.g. emscripten). Hence, when compiling one gets a hard-error for narrowing conversions from unsigned long long to <unsigned type of smaller size>.
The bug is easily fixed by defining

using ska::size_t = unsigned long long

And replacing the size_t with ska::size_t in the implementation.

Also note that when size_t is of size 4 one gets a warning for overflow in some expressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant