Memory allocation in D (noob question)

Sean Kelly sean at f4.ca
Tue Dec 4 11:06:16 PST 2007


Steven Schveighoffer wrote:
> "Steven Schveighoffer" wrote
>> Another reason why this is seems to be a bug and NOT a feature:
>>
>>        string ab = "ab".idup;
>>        string a = ab[0..1];
>>        a ~= "c";
>>        writefln("ab = ",ab); // also outputs "ac"
>>
>> This changes an invariant string without compiler complaint!
> 
> more bugs :)

This is expected behavior.


Sean



More information about the Digitalmars-d mailing list