[Issue 10176] New: std.array.extend?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 26 06:14:16 PDT 2013


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

           Summary: std.array.extend?
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-05-26 06:14:15 PDT ---
Maybe it's worth adding a std.array.extend() function that's similar to "~="
but accepts a lazy range (in theory, in a language where ranges are built-ins,
~= should append ranges too to arrays).

In std.array there is a join, but it creates a whole new array. It's usually
more efficient to extend arrays.


foreach (x; myrange)
    myarray ~= x;


Is replaced by:

myarray.extend(myrange);

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