Discussion: Rvalue refs and a Move construtor for D

Suleyman sahmi.soulaimane at gmail.com
Tue Sep 3 01:07:18 UTC 2019


I updated the POC.

You can now declare the move constructor & move opAssing like the 
following:

```
struct S
{
     this(ref S) @move {}     // move constructor
     opAssign(ref S) @move {} // move opAssign
}
```

Or with rvalue ref:

```
struct S
{
     this(@rvalue ref S) {}     // move constructor
     opAssign(@rvalue ref S) {} // move opAssign
}
```

All implementations use rvalue ref internally. It's just a matter 
of exposing in the language it or not.


More information about the Digitalmars-d mailing list