Discussion: Rvalue refs and a Move construtor for D

Manu turkeyman at gmail.com
Mon Sep 9 01:09:52 UTC 2019


On Sun, Sep 8, 2019 at 5:45 PM Suleyman via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Monday, 9 September 2019 at 00:28:17 UTC, Manu wrote:
> > Right, you wanna make it a type constructor.
> > This should be the case also for ref and scope too... but you
> > will
> > *never* get that past Walter.
> > This thing you describe is the single biggest fundamental
> > mistake in
> > D, storage class is improperly used for a bunch of stuff. It's
> > been
> > killing me slowly for a very long time... and I'm confident
> > after so
> > many years that you will not succeed.
> >
> > Supporting cast(@rvalue) doesn't depend on this anyway... you
> > can make that expression work either way.
>
> I'm not bothered too much with ref as long as we have solid
> pointer types. scope is a compiler hook not that much useful to
> the programmer.

It is though, scope has all the problems ref does, except they're
worse because there's no language to deal with them at all.
For instance, perfect forwarding can't deal with scope. We have talked
about `auto ref` being able to address the perfect forwarding issue
with `@rvalue ref`, but `scope` and `return` has never had any kind of
solution.


More information about the Digitalmars-d mailing list