Programming in D p288. Destructor called too many times.
Brother Bill
brotherbill at mail.com
Wed Feb 11 12:41:50 UTC 2026
On Tuesday, 10 February 2026 at 20:37:04 UTC, Nick Treleaven
wrote:
> If you add a copy constructor to Duration, you can see when it
> gets copied:
```
> this(ref Duration d)
> {
> this.tupleof = d.tupleof;
> writeln("copying Duration: ", toString);
> }
```
The ```ref``` is needed to avoid yet another copy.
Please explain what ```this.tupleof = d.tupleof;``` does in
detail.
More information about the Digitalmars-d-learn
mailing list