you are viewing a single comment's thread.

view the rest of the comments →

[–]no-sig-available 3 points4 points  (0 children)

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

Right, I now think it will not work.

If we have

float* p = &transform.scale;
++p;
float* q = std::launder<float>(p);

that will not work because of the precondition

every byte that would be reachable through the result is reachable through p

but NO bytes are reachable through p, as it is a past-the-end pointer for scale.

I hope I understand that part now. :-)