Tuple + foreach

%u BardzoTajneKonto at interia.pl
Tue Jan 2 06:48:57 PST 2007


import std.stdio;

template Print(A ...) {
    void print() {
        foreach(byte a; A) {
            writefln(a);
        }
    }
}

void main() {
    Print!(1,'a',"str",6.8).print();
}

dmd compiles this code with no error. Shouldn't it be an error to declare a as byte?



More information about the Digitalmars-d mailing list