Question about mutable arrays

A Bothe info at alexanderbothe.com
Fri Nov 20 06:42:55 PST 2009


These lines were just a basic idea...of course I have to fill the array...

string[] a=new string[2];

a[0]="A";
a[1]="B";

my idea was to create a list class to store something in it...

class List(T)
{
T[] arr;

// ctors and such

void opIndexAssign(T e,int i)
{
     arr[i]=e; // And here it throws the exception that arr is not mutable...
}
}


More information about the Digitalmars-d-learn mailing list