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.