'int' is enough for 'length' to migrate code from x86 to x64

Sean Kelly via Digitalmars-d digitalmars-d at puremagic.com
Thu Nov 20 07:29:35 PST 2014


On Thursday, 20 November 2014 at 00:08:08 UTC, Andrei 
Alexandrescu wrote:
>
> I think we're in good shape with unsigned.

I'd actually prefer signed.  Index-based algorithms can be tricky 
to write correctly with unsigned index values.  The reason size_t 
is unsigned in Druntime is because I felt that half the memory 
range on 32-bit was potentially too small a maximum size in a 
systems language, and it's unsigned on 64-bit for the sake of 
consistency.


More information about the Digitalmars-d mailing list