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

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Sat Feb 13 12:24:12 PST 2016


On Saturday, 13 February 2016 at 20:11:45 UTC, rsw0x wrote:
> D "guarantees" NRVO which is what enables its move semantics, 
> C++ did/does not.
>
> Quotes because IIRC(?) it used to be part of the spec and it 
> isn't anymore, I don't think Walter or Andrei have addressed 
> this yet so I'm not sure if it's intended.

By NRVO I assume you mean:

https://en.wikipedia.org/wiki/Return_value_optimization

All the common C++ compilers do RVO, but you don't need that to 
implement move semantic-like behaviour in C++03.

I wouldn't call RVO move semantics at all...


More information about the Digitalmars-d mailing list