When you read the documentation for ImmutableArray and ImmutableList, you can see that:
ImmutableArray<T>
has been implemented as astruct
ImmutableList<T>
has been implemented as aclass
Question:
Can you explain why such design decision?
Especially, why ImmutableArray<T>
is a struct
.
After all, System.Array
is a class
so, why it isn't the case for ImmutableArray<T>
?
This article sheds a bit of light on the decision to make .Net ImmutableArray a "struct" instead of a class:
See also: