Use copy function in generated dup function for structs if necessary