C++ Logo

std-discussion

Advanced search

Re: Standard guarantees on moved-from container

From: (wrong string) Åberg <haberg-1_at_[hidden]>
Date: Mon, 1 Jul 2024 20:49:06 +0200
> On 1 Jul 2024, at 20:34, Tiago Freire <tmiguelf_at_[hidden]> wrote:
>
> It could be implemented by using swap, but it could also be implemented by not using swap, that's the thing.

Actually, this is for operator=. For a constructor the constructed object does not exist.

The moved from object should be in a valid, but unspecified state, so there seems to be nothing that guarantees it to be empty.

Received on 2024-07-01 18:49:24