www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 439] New: Cannot use an array as new[] size argument.

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: godaves 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
}


-- 
Oct 17 2006
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=439


benoit tionex.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE







*** This bug has been marked as a duplicate of 411 ***


-- 
Oct 17 2006