[Issue 1869] Semantically returning an array from a funciton is difficult

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 25 15:21:33 PST 2008


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





------- Comment #3 from shro8822 at vandals.uidaho.edu  2008-02-25 17:21 -------
Hm. I'm almost sure I've done that before. And no, I use 1.0.

If my examples don't work, I think it should be considered a bug (in the design
if not the implementation).

On seconds though, you point out that a struct can be returned. This will
actually be done by value (returning a struct with an int[4] inside will copy
4*int.sizeof bytes) D might be interpreting returning int[4] in that way and
refusing (that could get real nasty with some template code computing n=1e6 or
some such).

If that is the case, why does it treat it as values on return and as references
on pass?


-- 



More information about the Digitalmars-d-bugs mailing list