I'm working on a class that is storing a 2D array of class MyType
and would like it to use dynamic data types. i.e. not MyType[,]
The problem with MyType[,]
is that the class doesn't know the size of the array ahead of time, and I don't want to go to the trouble of managing array re-sizing if it's been done elsewhere in the .NET Frameworks.
The class will not know maximum array size at any given moment, but the array will be dense. I know I can use static arrays, and re-allocate memory as needed, but I'd prefer to use a built-in implementation if possible.
Is there anything better than List<List<MyType>>
for this purpose?
Edit 1: specified that array is dense;
Edit 2 and 3: specified problem with MyType[,]