Move Constructor Syntax

Manu turkeyman at gmail.com
Tue Oct 15 09:26:06 UTC 2024


On Mon, 14 Oct 2024 at 12:54, Walter Bright via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On 10/11/2024 8:44 AM, Manu wrote:
> > No that's wrong; this is EXACTLY the situation that move semantics exist
> to
> > address. Move constructor like this should ACTUALLY BE a move
> constructor!
>
> But currently this(S) is an rvalue constructor, not a move constructor.
> I've
> said this many times.
>

I've also said many times; an rvalue constructor is a move constructor for
all intents and purposes.
Show me a case study; what might you do with an rvalue constructor if not
initialise an instance from an rvalue?

Changing it would break existing code.
>

That's fine. It's already broken; OR, it's already a move constructor.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20241015/131789de/attachment.htm>


More information about the Digitalmars-d mailing list