Am Samstag, den 18.09.2010, 02:15 -0700 schrieb Jonathan M Davis: > Okay, if I try and compile the following program. > > struct S > { > @property S save() const > { > return this; > } > > int[] _val; > } > > void main() > { > } >
Actually, wouldn't it be much more simple to just copy the struct instance directly, without a save() method: S s1; S s2 = s1; And you could add a postblit to control the copy behavior concerning _val. Or if save() is supposed to behave different than normal copying maybe something like this could be the solution: S save() const { return S(_val.dup); }