Iterating a typle tuple of templates

bearophile bearophileHUGS at lycos.com
Thu Mar 3 19:37:15 PST 2011


I am allowed to create a type tuple of function templates, but then it seems I am not allowed to use a static foreach on that type tuple:


import std.typetuple;

int foo(T)(T x) {
    return 0;
}

void main() {
    alias TypeTuple!(foo, foo) t2;
    static assert(t2[0](0) == 0); // OK
    static assert(t2[1](0) == 0); // OK
    foreach (t; t2) {} // Error
}


Is this expected, a bug in my code, a known bug in DMD, a new DMD bug, a limitation meant to be removed, etc?

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list