
30 Sep
2011
30 Sep
'11
3:31 p.m.
Why not? Isn't an object equal to itself?
Because a singular iterator can be a uninitialized variable and you can't equally-compare a uninitialized variable, nor copy it. All you can do is assign and destroy it.
I know what the standard says, but shouldn't this always return true? int* i; assert(i == i); Regardless of the actual value? It seems to me that this is a pretty fundamental property: an object is always equal to itself*. If you believe it, then you're allowed to construct empty bounded ranges of singular values [i, i). * Excluding volatile objects.