placeholder

Hasnain says:

Gotta love C++! I'd always thought of this as a quirk to trip people up, but hey here's a semi legitimate use case!

"Therefore, if your evaluation of the index may have a side effect on the evaluation of the pointer, you can flip the order to force the index to be calculated first.

auto test()
{
return index()[p];
}
Astound your friends! Confuse your enemies!"

Posted on 2023-04-04T04:16:18+0000