Remix.run Logo
AnimalMuppet 4 days ago

Problem 1 happens, say, 10% of the time when using a C struct.

Problem 2 happens only when doing SLAB allocations - say, 1% of the time when using a C++ class. (Might be more or less, depending on what problem space you're in.)

Problem 3 happens only if you are also declaring your allocated stuff const - say, maybe 20% of the time?

So, while not perfect, each solution solves most of the problem for most of the people. Complaining about std::launder is complaining that solution 2 wasn't perfect; it's not in any way an argument that solution 1 wasn't massively better than problem 1.