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

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


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


bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc


--- Comment #3 from bearophile_hugs at eml.cc 2012-10-29 15:38:29 PDT ---
This too fails:

void main() {
    char[5][2] cs;
    cs[].join(",");
}


This is a work-around, but I agree it's too much complex and it produces too
much garbage for the collector (all those dup):

import std.stdio, std.array, std.algorithm;
void main() {
    char[5][2] cs = 'x';
    char[] j = map!(r => r.dup)(cs[]).join(",");
    writeln(j);
}


So I agree join() should support fixed-size arrays of 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