Re: Array types and index types

2024-02-27 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 28, 2024 at 03:00:55AM +, Liam McGillivray via Digitalmars-d-learn wrote: > In D, it appears that dynamic arrays (at least by default) use a ulong > as their key type. They are declared like this: > ``` > string[] dynamicArray; > ``` > > I imagine that using a 64-bit value as the

Array types and index types

2024-02-27 Thread Liam McGillivray via Digitalmars-d-learn
In D, it appears that dynamic arrays (at least by default) use a ulong as their key type. They are declared like this: ``` string[] dynamicArray; ``` I imagine that using a 64-bit value as the key would be slower than using 32 bits or 16 bits, and 64 bits is way overkill for nearly