News for hackers. Stuff that matters.
Re:Why introduce `std::launder` rather than have the compile... by gpderetta on Saturday January 22, 2022 @01:00PM (#30039106)
Note that accessing the new object via the pointer to placement new is perfectly fine, the issue is dereferencing the old pointer that logically point to an object whose lifetime has been terminated even if it mught actually contain the same bit pattern as the new pointer. I think this is related to the ill-defined concept of pointer provenance.

Launder let you discard any provenance info for the old pointer and treat it as a new one.

Tricky and very ill-defined, and according to the another comment elsethread this now doesn't require launder anymore (it probably was proven unworkable in practice).

There are no comments on this comment yet.