4 ms·
I thought it was UB to use < on pointers outside of the same block of memory. e.g. your function is fine if the answer is true, but UB if the answer is false.
by yoklov 10y ago
I thought it was UB to use < on pointers outside of the same block of memory. e.g. your function is fine if the answer is true, but UB if the answer is false.
I could be misremembering though, but I do know I'd always cast to uintptr_t for this.