Search code examples
arraystypesd

D Array Key Type


When working with static arrays, what's type of the key of the array? I am sure I've seen it being mentioned before but I can't find it again.

Also the documentation says the size of a static array cannot exceed 16MB. Does this mean that when creating a byte array, the array can be bigger, as in have more different key-value pairs, than when using say long?


Solution

  • the key type of byte[1024] is size_t just like it is for dynamic arrays

    size_t is an alias of an integral type specifically for indices