Mutable structs are error-prone; dictionary[0].Inflate(1,1)
doesn't behave the same as array[0].Inflate(1,1)
would when T
is a Rectangle (since array[0]
is a variable, whereas dictionary[0]
is a value).
If I make a custom indexer for SomeClass
:
public T this[int x, int y] { get { return arr[y*100+x]; } }
Is someclass[x,y]
a variable or value or neither? Presuming T
is, of course, a struct
.