a struct as an multidimensional array index

Chris Katko ckatko at gmail.com
Fri Jun 10 08:08:45 UTC 2022


Is it somehow possible to use a struct as a [multidimensional] 
array index:

````D

struct indexedPair
{
size_t x, y;
}

bool isMapPassable[100][100];
auto p = indexedPair(50, 50);

if(isMapPassable[p]) return true;

````

Probably not, but I'm curious.


More information about the Digitalmars-d-learn mailing list