how would D be different if string were const(char)[]?

Dicebot public at dicebot.lv
Thu Oct 17 06:18:19 PDT 2013


On Thursday, 17 October 2013 at 13:08:18 UTC, Daniel Davidson 
wrote:
> If it would be no different then why prefer immutable(char)[] 
> for string?

Allocation-free slicing would have been illegal/unsafe then as 
someone could have possibly modified underlying chars via mutable 
reference.


More information about the Digitalmars-d-learn mailing list