On Wednesday, July 22, 2015 04:29:23 Taylor Gronka via Digitalmars-d-learn wrote: > I have a template function, and I want it to do something if the > input variable is a list of structs, and something else if the > input is a struct.
If you want a template to be different for different types, then overload it via template constraints. e.g. auto query(T)(string s) if(isDynamicArray!T) { } auto query(T)(string s) if(!isDynamicArray!T) { } You can use static if internally instead if the difference in code between the two is small, though in most cases, unless the types are very similar, it's cleaner to use a template constraint. - Jonathan M Davis