C++ Logo

sg12

Advanced search

Re: [isocpp-core] P3006 Launder less after placement new

From: Jason Merrill <jason_at_[hidden]>
Date: Tue, 17 Oct 2023 10:56:00 -0400
On Mon, Oct 16, 2023 at 3:45 AM Antony Polukhin via SG12 <
sg12_at_[hidden]> wrote:

> The discussion "Is it valid use reinterpret_cast to form pointer to
> object?" [0] motivated me to try to simplify things for the language
> users.
>
> I'd appreciate any feedback and help with the
> https://isocpp.org/files/papers/P3006R0.html wording.
>

We've been trying to move away from loose aliasing semantics for plain
'char', especially now that we have std::byte. I think we should leave it
out of this change.
Specifically, we don't include plain char in "provides storage" (
https://eel.is/c++draft/intro.object#3).

Actually, it would probably be better to refer to "provides storage" in the
proposed change, e.g. something like

"one is an array of std::byte or unsigned char and the other is an object
for which the array provides storage, created at the address of the first
array element"

Jason

Received on 2023-10-17 14:56:14