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

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 24 01:36:22 PDT 2017


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.



More information about the Digitalmars-d mailing list