Adding convenience CloneTo(..)

This commit is contained in:
Pavel Shevaev 2023-08-01 12:40:27 +03:00
parent 2dee7aa756
commit fc4a2403da
1 changed files with 8 additions and 3 deletions

View File

@ -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)}}