[Issue 9711] New: extend IFTI to deduce static array length

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 13 15:08:03 PDT 2013


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

           Summary: extend IFTI to deduce static array length
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: timon.gehr at gmx.ch


--- Comment #0 from timon.gehr at gmx.ch 2013-03-13 15:08:02 PDT ---
IFTI can deduce both the value and key types for associative arrays:

auto deduceKeyAndVal(T,S)(T[S] a){ return a; }
static assert(is(typeof(deduceKeyAndVal(["1":1,"2":2,"3":3]))==int[string]));


It would be nice if it could also deduce static array lengths:

auto deduceLength(T,size_t n)(T[n] a){ return a; }
static assert(is(typeof(deduceLength([1,2,3]))==int[3]));

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