searches the range [
first,last) for two consecutive identical elements.Return value
an iterator to the first of the first pair of identical elements, that is, the first iterator
itsuch that*it == *(it+1)for the first version orp(*it, *(it + 1)) != falsefor the second version.If no such elements are found, last is returned
However, it is not clear how it is supposed to handle the range {last, last}.
Both possible implementations on cppreference have the following check:
if (first == last) {
return last;
}
Is std::adjacent_find(last, last) UB or the standard does define it?