Does D support nested Templates aka Higher Kinded Polymorphism?

sighoya sighoya at gmail.com
Tue Oct 3 13:31:00 UTC 2017


Thanks,
How do I construct such a type. I don't get it done right with:

struct Foo(T) {
	T value;	
}

struct Bar (R,S) {
	R!S fooint;
}

T!(S!R) bar(alias T,alias S,R)(T!(S!R) v) {return v;}


void main() {
	import std.stdio;	
	writeln(bar!(Bar,Foo,int)(Bar!(Foo!int(1.0))));
}




More information about the Digitalmars-d-learn mailing list