On Wednesday, 9 October 2013 at 15:33:23 UTC, Ali Çehreli wrote:

That string is independent from the argument (i.e. Bar.name). They initially share the same characters. Either of those strings can leave this sharing at will, and that is exactly what name="tess" does. 'name' now refers to different immutable chars.


And to prove it - change main to:

void main(string[] args)
{
    auto bar = new Bar();
    bar.test();
    writeln(Bar.name);
}

and as much as you may want to become tess, you will still be gary.

Reply via email to