[Issue 439] New: Cannot use an array as new[] size argument.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 17 03:06:51 PDT 2006


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

           Summary: Cannot use an array as new[] size argument.
           Product: D
           Version: 0.169
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: godaves at yahoo.com


const size_t[] arr = [ 1,2,3 ];

void main()
{
    int[] ar2, ar3;
    ar2 = new int[arr[2]];   // "need size of rightmost array, not type arr[2]"
    ar2 = new int[](arr[2]); // Ok
    size_t i = arr[2];
    ar2 = new int[i];        // Ok
}


-- 




More information about the Digitalmars-d-bugs mailing list