Post #1593411
2026-04-07 09:08 UTC
In my latest blog post, "What reinterpret_cast doesn't do," you'll learn about one of C++'s biggest pitfalls and how to avoid it.
https://andreasfertig.com/blog/2026/04/what-reinterpret_cast-doesnt-do/
#cplusplus #cpp #cpp20 #cpp23
Replies (1)
-
@manx@mastodon.online 2026-04-07 11:00
@andreasfertig@mas.to May I suggest that you explain more thoroughly that std::start_lifetime_as still requires properly aligned memory. In almost all cases, it is also Undefined Behaviour just like reinterpret_cast is, if the memory comes from somewhere that does not guarantee proper alignment for the destination type. In particular, I consider your older post and example at completely broken. Please do not teach it this way.