Move Constructor Syntax

Salih Dincer salihdb at hotmail.com
Tue Oct 8 00:31:44 UTC 2024


On Monday, 7 October 2024 at 18:04:58 UTC, H. S. Teoh wrote:
>
> What about:
>
> 	this(~T t)
>
> The ~ being an allusion to ~this, the idea being that after the 
> move the operand t will effectively have been destructed and 
> invalid.

Before you decide that, consider how often we use the ~ symbol. 
But isn't this (option 2) more meaningful?

**this**(**=MyStruct** name) { ... }

**The ~ Symbol in D**

* String/Array concatenation
* Bitwise complement
* Dynamic expanding array
* Destructuring functions
* Exclusive operator with opOpAssign

SDB at 79


More information about the Digitalmars-d mailing list