[Issue 8910] Static arrays, dynamic arrays and std.array.join

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 30 14:24:28 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8910



--- Comment #18 from timon.gehr at gmx.ch 2012-10-30 14:24:25 PDT ---
(In reply to comment #15)
> (In reply to comment #14)
> > (In reply to comment #11)
> > > ...
> > >  map!(c => c[])(cs[]).join(",");
> > > ...
> > 
> > This is not valid.
> 
> Huh. So it isn't, it compiles however, just garbage output.
> What *is* it doing differently?
> ...

This copies the static arrays to a function-local parameter, slices them and
returns those slices. i.e. it escapes stack addresses. It should be a compile
error.
Mine implicitly slices the original static arrays before they are passed in and
returns those slices.

-- 
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