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



--- Comment #5 from d...@dawgfoto.de 2012-02-16 22:03:04 PST ---
The reason why this works with structs but not with templates is that a struct
preserves the full type information while an alias template transforms a type.

void bar(Ty)(Ty) { pragma(msg, Ty); }

struct SList(T) {}
template TList(T) { alias T TList; }

void main()
{
    bar(SList!int.init); // type SList!int => SList!int is preserved
    bar(TList!int.init); // type int       => TList!int is lost
}

Now if you take a function void foo(T)(TList!T) {} and gives you 'TList(T) =
int'.
What your asking for is an inverted template 'TList^-1(int) = T'.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to