string types: const(char)[] and cstring

Derek Parnell derek at psych.ward
Sun May 27 16:46:56 PDT 2007


On Sun, 27 May 2007 16:32:57 -0700, Walter Bright wrote:

> Derek Parnell wrote:
>> On Sun, 27 May 2007 12:14:29 -0700, 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?
>> 
>> 
>> Any comment on the above?
> 
> Looks right to me.

But didn't you say that "invariant char[]" means that "invariant" applies
to both the array reference and the contents? In other words its the same
as "invariant (char[])" but above I said that this means that the array is
immutable but the contents are not. 

What is the syntax for an immutable array of mutable characters?

-- 
Derek Parnell
Melbourne, Australia
"Justice for David Hicks!"
skype: derek.j.parnell



More information about the Digitalmars-d-announce mailing list