Move construction from !is(T == typeof(this))

Manu via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 24 06:18:41 PDT 2017


On 24 April 2017 at 18:36, Ola Fosheim Grøstad via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On Monday, 24 April 2017 at 04:21:36 UTC, Manu wrote:
>
>> Now, I'm not saying that rval references are the only solution here, just
>> that I can overload the construction from an X for the rvalue and
>> non-rvalue case, which is what I want...
>>
>
> What I've done in the past is simply to create a movable_ref pointer-type.
> AFAICT that would be similar to C++ "&&" except it isn't downgraded when
> used as a parameter (which is a language feature). C++ provide that
> downgrading so that programmers don't accidentally forward a reference as a
> movable reference without making it explicit.
>

I've done that too, but that's a seriously shit solution.
You didn't comment on any of my actual questions ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20170424/5b005f62/attachment.html>


More information about the Digitalmars-d mailing list