[Issue 7529] IFTI does not support template argument dependent template alias instances as parameter types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 16 22:03:05 PST 2012


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



--- Comment #5 from dawg at 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: -------


More information about the Digitalmars-d-bugs mailing list