[Issue 2548] New: Array ops that return value to a new array should work.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 30 14:39:53 PST 2008


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

           Summary: Array ops that return value to a new array should work.
           Product: D
           Version: 2.022
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: dsimcha at yahoo.com


import std.stdio;

void main() {
    double[] foo = [1.0,2,3,4,5].dup;
    double[] bar = [6.0,7,8,9,10].dup;
    auto baz = foo[] + bar[]; //Error: Array operation foo[] + bar[] not 
implemented

}

Ideally, the compiler should create baz and put the result of foo[] + bar[] in
this newly created array.  If the goal of not allowing this behavior is to
avoid hidden memory allocations, then a more informative error message should
be displayed.


-- 



More information about the Digitalmars-d-bugs mailing list