Move Constructors - Converting Lvalues to Rvalues

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


On 01/10/2024 3:58 PM, Atila Neves wrote:
> On Monday, 30 September 2024 at 20:28:05 UTC, Richard (Rikki) Andrew 
> Cattermole wrote:
>> I suspect that we're going in an entirely wrong direction with move 
>> constructors for two reasons:
>>
>> 1. Nobody has been able to answer what the purpose of them is, is it 
>> an optimization, is it ownership transfer system (which is better done 
>> with isolated).
> 
> My understanding is that we need SSA in order to implement isolated. And 
> so for now I'd say it's an optimisation mostly, but also bug prevention 
> with move-only types.

SSA? What? That has nothing to do with it.

If you want isolated to not have its own analysis you need type state 
analysis, which is DFA. The same DFA we should be using for escape analysis.

Forward pass only on success.

One of my concerns for move constructors is the addition of analysis 
that is in addition to the escape analysis DFA.



More information about the Digitalmars-d mailing list