Get the latest tech news
Implementing a Struct of Arrays
Recently, I watched Andrew Kelley’s talk on Practical Data Oriented Design. It goes into some of the architectural changes he’s been making to the Zig compiler, with pretty significant performance benefit. Would definitely recommend checking out the talk, even if you’re like me and have never written any Zig.
That would actually be simpler if I used std::construct_at, since I wouldn’t need to determine M. But in general I prefer placement new (especially since that’ll be constexpr in C++26 too) since it can do all kinds of initialization. One nice thing Zig has going for it is that, as a C language, you can just construct an undefined object and then piece-wise assign the members. This may prove difficult in C++ for a number of reasons, but I think it’s worth considering — especially as we’ll want to pursue more code generation utilities.
Or read this on Hacker News