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

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


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


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jmdavisProg at gmx.com
         Resolution|                            |WONTFIX


--- Comment #2 from Jonathan M Davis <jmdavisProg at gmx.com> 2012-10-29 15:35:15 PDT ---
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).

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