On 08/21/2016 12:11 AM, Engine Machine wrote:
Is there a way to rebind the arguments of a template?template foo(X) { // X is like A!(a,b,c) Y = Rebind!(X,d,e,f); // Y is like A!(d,e,f); } foo(A!(a,b,c)); ?
template Rebind(alias instance, newArgs...) { import std.traits: TemplateOf; alias tmpl = TemplateOf!instance; alias Rebind = tmpl!newArgs; }