On Tuesday, October 2, 2018 5:40:18 AM MDT Vinod K Chandran via Digitalmars- d-learn wrote: > Hi all, > I have a function and i want to convert this into a template so > that i can use this function for more than one data type. > This is my function. > ```D > void ArrayAdd( ref int[] x, int value) { > int index = x.length ; > x.length += 1 ; > x[index] = value ; > } > ```
Why do you have a function for that? All you need to do is use the append operator. e.g. x ~= value; - Jonathan M Davis