On 30/05/15 09:36 +, Jörg Richter wrote:
>How about comparing only the length against 0?
>The pointers must be != 0 if length > 0.
Like so? Yes, that's probably an improvement, because we need that
length anyway.
Yes, that is what I had in mind.
I think the second case can be handled equal
std::equal((int*)0, (int*)0, p) and std::equal(p, p, (int*)0) are
valid for any input iterator p, and must not pass a null pointer to
memcpy.
Similarly, std::lexicographical_compare((int*)0, (int*)0, p, q) and
std::lexicographical_compare(p, q, (int*)0, (int*)0) are valid for any
input iterators