I have implemented begin and end functions for MFC containers. The iterators are pointers to the internal data and may be null pointers for an empty container. What happens if both are null pointers and user compares them with <
or <=
?
Other questions or their answers talking about comparisons of null-pointers with non-null pointers. This question is especially about comparing two null-pointers.
Furthermore it is of interest what the standard has to say about it.
Yes, this is well defined: a null pointer value “compare[s] equal” to itself ([expr.eq]/3.2), so <
and >
yield false
and <=
and >=
yield true
([expr.rel]/5).