Move Constructors - Converting Lvalues to Rvalues

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Tue Oct 1 03:29:05 UTC 2024


On 01/10/2024 4:22 PM, Walter Bright wrote:
> On 9/30/2024 10:49 AM, Dukc wrote:
>> Doesn't `core.lifetime.move` already do this?
> 
> Since the compiler doesn't know about it, the potential for 
> optimizations, lifetime analysis, etc., is lost.

If only there was a way that was backwards compatible, for us to 
annotate on a parameter that it invalidates the input in the form of a move.

Perhaps an attribute, like ``@move`` in core.attributes would be 
sufficient for this task ;)



More information about the Digitalmars-d mailing list