You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quick review of std::bit_cast and any of its limitations
(New in C++23) start_life_timetime_as and start_lifetime_as_array
Length
Longer form (~10 min)
Note
I know there is an existing suggestion here from 2022 on this C++23 feature, but I really wanted to bump it. Pointer aliasing continues to be a very common source of UB from my experience inside and outside the workforce, and I really want more attention on this topic since a true solution is coming in C++23.
The text was updated successfully, but these errors were encountered:
indeed.
Yet they are lot's of expectation about type punning and lots of wrong info about what is possible or not with C++. start_life_time_as only covers a special case.
I think that they are many episode suggestions about that and there is already an episode about reinterpret_cast. But there is more to that: implicit_lifetime objects, allocation/deallocation in presence of type-punning, std::launder correct usage (and what it cannot do also),...
Channel
C++ Weekly
Topics
reinterpret_cast
std::bit_cast
and any of its limitationsstart_life_timetime_as
andstart_lifetime_as_array
Length
Longer form (~10 min)
Note
I know there is an existing suggestion here from 2022 on this C++23 feature, but I really wanted to bump it. Pointer aliasing continues to be a very common source of UB from my experience inside and outside the workforce, and I really want more attention on this topic since a true solution is coming in C++23.
The text was updated successfully, but these errors were encountered: