[[pure]]. If I remember correctly, I must be 100% sure that a particular input should always return a specific output. Given that const globals and static const globals should never change states, this should be fine. Finally, reading a pointer that can change states will not be a pure function. If you write to pointers available elsewhere, then it has a side effect and is not [[pure]].
You must ask yourself if the result of the function is dependent on the state of extraneous variables, and if you answer yes, it is not [[pure]]. You should also ask yourself if the input can influence anything other than the return value. If this is true, then it is not [[pure]]
source
share