3 ms·
I don't use int64_t and expect it to exist. I use int64_t and expect compilation to fail if stdint.h doesn't define it. It would be a problem, but much less of
by PaulDavisThe1st 6y ago
I don't use int64_t and expect it to exist. I use int64_t and expect compilation to fail if stdint.h doesn't define it. It would be a problem, but much less of a problem than using intWhatever_t, having compilation work, but having no idea what the bounds were.
intmax_t doesn't define an upper limit either, as TFA explains, because you don't know at runtime what the limit really is.
- josefx 6y ago> but having no idea what the bounds were. The idea for the library writer are that the bounds are large enough for whatever the user needs. User inputs a int64_t? Great the type intmax_t on that system is at least int64_t wide by definition. System doesn't have a int64_t ? Great the user can at best use a int32_t, which intmax_t would once again support. > intmax_t doesn't define an upper limit either, as TFA explains Yeah, it would almost be sad that C++ is getting bitten by Cs lack of name mangling. Almost because it is kinda pointless to define a maximum integer in a language where any programmer can add their own fixed sized integer types, so a generic library supporting arbitrary sized integers would have to take template parameters anyway.