diff --git a/tpl/macro.twig b/tpl/macro.twig index 164bf85..747189e 100644 --- a/tpl/macro.twig +++ b/tpl/macro.twig @@ -54,11 +54,16 @@ public {{_self.struct_type(o)}} {{o.name}} {{_self.base_struct_class(o)}} } {{_self.comment_non_cloneable_begin(o)}} + public void CloneTo(ref {{o.name}} dst) + { + MetaSync.Clone(this, ref dst, AutogenBundle.createById); + } + public {{_self.virtual_clone(o)}} IMetaStruct clone() { - var copy = new {{o.name}}(); - MetaSync.Clone(this, ref copy, AutogenBundle.createById); - return copy; + var dst = new {{o.name}}(); + CloneTo(ref dst); + return dst; } {{_self.comment_non_cloneable_end(o)}}