www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10123] New: Can't subtract positive number from length of array of struct with disabled default construction

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10123

           Summary: Can't subtract positive number from length of array of
                    struct with disabled default construction
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com



15:38:29 MSD ---
---
struct S
{  disable this(); }

void main()
{
    S[] arr = [S.init, S.init, S.init];
    --arr.length; // Error: struct main.S default construction is disabled
    arr.length -= 1; // Same error
    size_t n = 1;
    arr.length -= n; // Same error
}
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 20 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10123




15:53:15 MSD ---
Looks like Issue 10124 have to be fixed first.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 20 2013