Move Constructor Syntax

Anonymous nomail at nomail.no
Sun Oct 6 19:00:09 UTC 2024


On Sunday, 6 October 2024 at 04:04:28 UTC, Walter Bright wrote:
> ```
> struct S { ... }
>
> this(ref S) // copy constructor
> this(this)  // postblit
> this(S)     // move constructor
> ~this()     // destructor
> ...
> ```
> ...
> A fix that would simplify the language and the compiler would 
> be to have a unique syntax for a move constructor,
> ...
>
> Something like one of:
> ```
> 1. =this(S)
> 2. this(=S)
> 3. <-this(S)
> ```
> ?

this move(...)
this copy(...)
this(...)
~this(...)



More information about the Digitalmars-d mailing list