[Issue 7161] Passing string literal by ref changes its bounds forever
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Dec 24 06:03:57 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=7161
--- Comment #4 from Denis <verylonglogin.reg at gmail.com> 2011-12-24 17:03:56 MSK ---
And a better one (CTFE friendly, no need to specify param number):
---
private ref string wrap(string s) {
static struct GCString { string str; }
auto gcStr = new GCString();
gcStr.str = s;
return gcStr.str;
}
---
Yes, hello Java-like arrays!
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list