string types: const(char)[] and cstring
Walter Bright
newshound1 at digitalmars.com
Sat Jun 2 18:25:46 PDT 2007
Tom S wrote:
> Walter Bright wrote:
>> Derek Parnell wrote:
>>> What is the syntax for an immutable array of mutable characters?
>>
>> There isn't one. Such a construct is appealing in the abstract, but I
>> haven't run across a legitimate use for it yet.
>
> Are we only talking strings here or general arrays? Because if general
> arrays are concerned, I can come up with an example.
In general.
> An immutable array of mutable data for... e.g. render to texture in a
> software renderer (or creating data for a hw texture, or whatnot) So you
> basically pass a texture buffer to a function. You don't want it to
> realloc the buffer, just to modify its contents...
>
> What am I missing here? ;)
We can all come up with an example, the more interesting case is is it a
compelling example? I'm not seeing that.
More information about the Digitalmars-d-announce
mailing list