3 ms·
Unfortunately, C++ const functions are not necessarily pure functions and cannot be freely reordered.
by mlyle 7y ago
Unfortunately, C++ const functions are not necessarily pure functions and cannot be freely reordered.
- vortico 7y agoYou're right, I was mistaken. And if the function is in the same compilation unit so the compiler is able to prove that it's pure, it would also be able to prove that a non-const pointer is actually const.