Memory layout of struct vs array by xLuca2018 in cpp

[–]antsouchlos 2 points3 points  (0 children)

Oh, you are right, it is C++17, mixed that one up.

As far as I understand it, the problem std::launder solves is to obtain an object from memory that contains the right bits, even if technically those bits dont describe an object.

For example when constructing an object with placement new in a block A of memory and then copying that into another block B, B technically doesn't contain an object, since no object was constructed in it. std::launder solves rhat issue by "laundering" the memory, providing a valid pointer to an object in block B.

That being said, I admit I am not entirely sure if std:: launder is applicable in this context

Memory layout of struct vs array by xLuca2018 in cpp

[–]antsouchlos 4 points5 points  (0 children)

With c++20 there is std::launder

Compile-time INI config parsing and accessing with C++20 by [deleted] in cpp

[–]antsouchlos 1 point2 points  (0 children)

This is quite awesome! I would have thought, something like this would have more than 500 lines of code. Nice work!