D's equivalent to C++'s std::move?

rsw0x via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 3 19:52:23 PST 2016


On Thursday, 4 February 2016 at 03:45:57 UTC, maik klein wrote:
> On Thursday, 4 February 2016 at 01:26:55 UTC, Andrei 
> Alexandrescu wrote:
>> [...]
>
> I am in a similar boat as Matt Elkins. The problem is not D's 
> move semantics, but that Phobos does not support them at all.
>
> I have already several things that are not copyable, one of 
> them is "Unique". It feels incredibly restrictive to use those 
> in D. You can not put them in Arrays, you can not put them in 
> Tuples, you can not use writeln on them, you can basically not 
> use them at all in Phobos because pretty much everything relies 
> on copying.
>
> I have currently written tons of stuff from scratch just to 
> support a few non copyable types. This is probably my biggest 
> complain about D so far.
>
> It might still be the case that I am missing something obvious 
> here.

Those are intended not to be copied, they must be explicitly 
moved with std.algorithm's move


More information about the Digitalmars-d mailing list