[Issue 1597] It is not possible to specialize template on associative array.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 19 15:35:45 PDT 2007


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





------- Comment #2 from andrei at metalanguage.com  2007-10-19 17:35 -------
While acknowledging this as a bug in the language, below is a fix for the time
being:

import std.stdio;

void parse(T, U = void, V = void)() {
    writeln("Wuddever");
}

void parse(T : U[V], U, V)() {
    writeln("Hash");
}

void main() {
    parse!(int[char[]])();
    parse!(int[])();
    parse!(int)();
}

The second suggestion:

void parse(T : E[])() {}

won't work because it's unclear whether E is a newly-introduced symbol ("must
be inferred") or a previously-defined symbol ("must be E that I defined in this
module").


-- 



More information about the Digitalmars-d-bugs mailing list