C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Detecting bitwise trivially relocatable types

From: Jan Schultke <janschultke_at_[hidden]>
Date: Wed, 2 Jul 2025 19:51:21 +0200
Hi,

I think this paper has excellent motivation and explains the problem
really well, with plenty of good motivating examples.

Perhaps it would benefit from including a summary of recent discussion
and polls that took place at Sofia. After all, it was suggested in
LEWG that a separate trait for bitwise trivial relocation could be
created.

The wording could be improved a bit.

> and trivially relocating objects of type T by means of calling trivially_relocate
> does not change the object representation of the objects being relocated.

This does not make too much sense; the original object is killed, so
in that way, its object representation does change. Also, the original
object representation doesn't really have to be modified anyway, if I
understand it correctly. Maybe something like

> and trivially relocating objects of type T by means of calling trivially_relocate
> is performed exclusively by copying the bytes of the object representation
> of the relocated object.

Also note that https://eel.is/c++draft/obj.lifetime#lib:trivially_relocate
is worded so that there are two separate objects; trivial relocation
does not actually relocate an object from one place to another (and
your wording goes in that direction); it creates new objects.

On another note, did you get in touch with the other authors of P1144?
It's a bit odd to see only one name on this paper.

Received on 2025-07-02 17:51:35