Transitive R-Value Inference and Move Construction a la Rust

Nordlöw via Digitalmars-d digitalmars-d at puremagic.com
Mon Sep 26 09:24:24 PDT 2016


On Monday, 26 September 2016 at 15:24:35 UTC, Nordlöw wrote:
> I just discovered the following interesting fact about the 
> current state of DMD:
> ...


Double-Doh!, I just realized my reasoning is wrong; the reason 
why the parameter `a` in call  `sub(a)` in `top` is not moved is 
instead because the compiler currently doesn't check whether `a` 
is used below the call to `sub(a)`. Something I believe is called 
data flow analysis. This optimization is however, still, very 
much possible and doesn't lead to the template bloat I argued 
about. Even better.

Sorry for the inconvenience and lack of insight.


More information about the Digitalmars-d mailing list