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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 29 15:40:40 PDT 2012


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



--- Comment #4 from bearophile_hugs at eml.cc 2012-10-29 15:40:38 PDT ---
(In reply to comment #2)
> The problem is that you're using static arrays, and they're not ranges. They
> will work with some range-based functions if you slice them (as their slice is
> a dynamic array), but static arrays themselves will not work. But you need to
> be careful when slicing them and passing the slices to range-based functions,
> because you're then slicing memory which is on the stack, and if it escapes the
> function, then it'll be pointing at invalid memory (since the static array
> won't exist anymore).

What you say doesn't explain why Phobos doesn't have a function to join a
built-in fixed-sized 2D array turning it into a single dynamic array. So I
think closing this issue is the wrong decision.

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