[Issue 4886] Template (alias) tuple parameters cannot take .length property in compiletime

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 19 17:45:30 PDT 2010


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


bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc


--- Comment #1 from bearophile_hugs at eml.cc 2010-09-19 17:44:54 PDT ---
Reduced test case:

template Foo(T...) {
    int[T.length] x;
}
static assert(Foo!(1, 2, 3).x.length == 3);
void main() {}



A workaround:

template Foo(T...) {
    int[cast(int)T.length] x;
}
static assert(Foo!(1, 2, 3).x.length == 3);
void main() {}

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