string types: const(char)[] and cstring

noSpam "pelekhay\" at (noSpam)gmail.com
Sun May 27 16:53:55 PDT 2007


Walter Bright wrote:
> Derek Parnell wrote:
>>  const(char)[]  // A mutable array of immutable characters?
>>  const(char[])  // An immutable array of mutable characters?
>>  const(const(char)[]) // An immutable array of immutable characters?
>>  char[]         // A mutable array of mutable characters?
>>
>> What will happen with the .reverse and .sort array properties when used
>> with const, invariant, and final qualifiers?
> 
> They'll all fail.

I think it's better to return reversed/sorted copy. This will make such 
change more backward compatibile.



More information about the Digitalmars-d-announce mailing list