The std::unique function compares two neighboring elements using the == operator, returns an iterator to the element that follows the last undeleted (not moved to the end). In our case, if we apply the algorithm without preliminary sorting, then an iterator equal to the end will be returned.
Войдите чтобы поставить Нравится
Войдите чтобы прокомментировать