Move Constructors - Converting Lvalues to Rvalues

Timon Gehr timon.gehr at gmx.ch
Thu Oct 3 01:08:44 UTC 2024


One thing that is a bit annoying is:

```d
void byval(S s);
void bymove(@move S s);

byval(move(s)); // has to move on call, caller can in principle elide 
the .init blit

bymove(s); // does not have to move on call, but callee has to leave 
argument in `.init` state and this reinitialization cannot be elided 
without inlining
```

Of course, it would be even better if `.init` were not required at all...


More information about the Digitalmars-d mailing list