Skip to content

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

Description

@ZigaSajovic

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions