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.
Ввійдіть щоб вподобати
Ввійдіть щоб прокоментувати