Why does 'string' alias immutable(char)[] and not immutable(char[]) ?

Trass3r un at known.com
Wed Dec 1 10:25:31 PST 2010


> This, I do not understand. I thought immutable applies to the value, not  
> to the variable.

You need to read from right to left.

immutable(char)[] is a mutable array of immutable chars.
immutable(char[]) is an immutable array of immutable chars. Note the  
transitivity.


More information about the Digitalmars-d-learn mailing list