[Issue 12625] [scope] [DIP1000] implicit slicing of RValue static array should be illegal

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Aug 31 07:53:34 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=12625

--- Comment #20 from Steven Schveighoffer <schveiguy at yahoo.com> ---
For those not following the PR in Phobos discussion, an interesting alternative
idea has been floated by ZombineDev:

char[16] get();

string s = get();

// can be lowered to:
auto _tmp = get();
scope string s = _tmp[];

Which should work and keep existing code intact. Requires dip1000 I believe.

--


More information about the Digitalmars-d-bugs mailing list