DMD 1.004 release

renoX renosky at free.fr
Sun Jan 28 00:23:48 PST 2007


Lionello Lunesu a écrit :
> "Walter Bright" <newshound at digitalmars.com> wrote in message 
> news:epgokh$2q2p$1 at digitaldaemon.com...
>> Jordan Miner wrote:
>>> Here is a problem I've found in post-1.00 versions.
>> What's happening is you're writing into the string literal, which is not 
>> allowed. String literals should be regarded as readonly.
>>
>> Post-1.00 versions combine identical string literals, which is why you see 
>> the error.
> 
> Shouldn't string literals be forced "const"? Even D's limited const could do 
> that.

Agreed! There's really not reason to create such blatant trap in D..

renoX

> To create a mutable copy you'd be forced to used .dup.
> 
> const char[] either = "asdfsadf";
> char[] or = "asdfsd".dup;
> 
> L. 
> 
> 



More information about the Digitalmars-d-announce mailing list