Recently, I watched this talk by Andreas Fertig at CppCon'24. He discussed some very interesting topics, including new C++ features and union-based optimizations for efficient C++ programming.

To fully understand this talk byte by byte, I tried to re-implement the examples and experiment on my own, figuring out details with the help of ChatGPT. But I quickly found myself going down a rabbit hole of unfamiliar concepts that I’m not quite up to grasp yet. Hence, I decided to write a chunk of posts to summarize the talk, records every related aspects and provide some thoughts.

Four topics are discussed in this talk:

  1. Empty Data Members – quite interesting and useful
  2. Small String Optimization – really complex
  3. Power of constexpr – some new insights with assembly code, but not very useful
  4. Initializer List – insights with assembly code, but still not really useful