DIP 1018--The Copy Constructor--Community Review Round 1

Neia Neutuladh neia at ikeran.org
Thu Dec 20 16:53:29 UTC 2018


On Thu, 20 Dec 2018 14:41:49 +0000, Kagamin wrote:
> On Wednesday, 19 December 2018 at 13:40:41 UTC, RazvanN wrote:
>> All this copies become useless when using the copy constructor.
> 
> A copy constructor is very verbose though, imagine a copy constructor
> for a struct with 30 fields, where it copies 29 fields and sets the 30th
> to null.

this.tupleof = other.tupleof;
this.field30 = null;

Pretty succinct.


More information about the Digitalmars-d mailing list