Why implicit conversion of string literal to char[] does not works?

Michal Minich michal.minich at gmail.com
Tue Jul 2 04:33:14 PDT 2013


On Tuesday, 2 July 2013 at 11:29:05 UTC, Dicebot wrote:
> On Tuesday, 2 July 2013 at 11:26:59 UTC, Michal Minich wrote:
>> But ... I'm asking only about implicit conversion of string 
>> literal, not arbitrary expressions of string type.
>
> char[] str = "abc".dup;

Thanks, that is workaround I didn't know about.

I'm really interested about reasons why it doesn't works (without 
dup/cast). At some point it had to be disabled. But I really 
cannot find a reason why that would be useful.




More information about the Digitalmars-d-announce mailing list