News for hackers. Stuff that matters.
Re:GCC 16 has been released by denotational on Thursday April 30, 2026 @01:01PM (#47965327)
If the type is an implicit-lifetime type, then you can legally create an unsigned char array, and then reinterpret_cast a pointer to that to a pointer to the type.

See https://eel.is/c++draft/intro.object#def:object,implicit_cre....

https://eel.is/c++draft/intro.object#15 is an example showing this with malloc; the subsequent paragraph further permits it to work with an unsigned char array.

Re:GCC 16 has been released by leni536 on Thursday April 30, 2026 @02:22PM (#47966364)
1. You still need std::launder in that case.

2. It doesn't initialize the object that is implicitly created, even if the storage has initialized chars.

Re:GCC 16 has been released by denotational on Thursday April 30, 2026 @06:27PM (#47969072)
The paper that introduced the implicit lifetime mechanism suggests that std::launder is not required: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p05....