move+forward as intrinsics, incl. revised forward semantics for perfect forwarding

Paul Backus snarwin at gmail.com
Sun Oct 13 15:16:23 UTC 2024


On Sunday, 13 October 2024 at 10:43:27 UTC, kinke wrote:
> * non-ref lvalues (NEW semantics): 're-interpret as rvalue' - 
> no move, and accordingly no destruction after forwarding 
> (because the rvalue will already be destructed earlier)
>   * invalid/undefined to access the original lvalue after 
> forwarding it (has been destructed already)

Unless the compiler can statically detect and prevent such 
accesses, this would make `forward!x` a `@system` operation, 
which IMO would be a step backward.


More information about the Digitalmars-d mailing list