Template type parameters with their own type parameters

Peter Lundgren lundgrpb at rose-hulman.edu
Fri Mar 4 19:02:27 PST 2011


I have a function that I think should look something like this:

MyStruct!T myFunc(T)(MyStruct!T x, ...) {
	...
	return MyStruct!T(...);
}

and the closest I can get to is:

T myFunc(T)(T x, ...) {
	...
	return T(...);
}

which works, but doesn't make clear the intended use and gets in the way of
overloading. How can I express the intent of the first version.


More information about the Digitalmars-d-learn mailing list