News for hackers. Stuff that matters.
Re:A half-hour to learn Rust by jcelerier on Saturday February 29, 2020 @07:23AM (#22450231)
> In C++ I've actually had code using a value like `42l` that works on Linux but not on Windows, because the sizes of those types aren't fixed.

if you want fixed size for literals you can use the "function macros for integer constants" :

    #include <cstdint>
    auto x = INT32_C(-456456435); // guaranteed at least 32-bit
    auto y = UINT64_C(45645654654321685768); // guaranteed at least 64-bit.

Those will enclose the constant in the proper literal suffix - ull on 32-bit windows and ul on linux for instance.

There are no comments on this comment yet.