Re:A Special Kind of Hell: intmax_t in C and C++
by m463 on Saturday December 05, 2020 @04:05PM
(#25318345)
I don't know how D handles it, but I got an extraordinary "all is right with the world" years ago when I saw ada with common definitions for bit order, max integers and digits.
[ Parent
| on HN ]
Re:A Special Kind of Hell: intmax_t in C and C++
by WalterBright on Saturday December 05, 2020 @05:55PM
(#25319234)
In D, the only size that varies is pointer size.
An int is 32 bits, a long is 64. Makes life much easier.
Re:A Special Kind of Hell: intmax_t in C and C++
by colejohnson66 on Sunday December 06, 2020 @09:00PM
(#25328657)
Same with C#. int is an alias for System.Int32 and long is an alias for System.Int64. (Or is it the other way around?)
Just don’t do what Java does and make Integer a class and int a value type. Then you end up with references and the “integer cache” garbage. https://viveksb007.github.io/2020/06/integer-cache-in-java