https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106869

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Yes, that's correct.

std::unique and std::ranges::unique only remove **consecutive** duplicates,
they don't search the entire range again and again for duplicates. So you need
to sort it first, or otherwise arrange for all duplicates to be adjacent to
each other.

https://en.cppreference.com/w/cpp/algorithm/unique

Reply via email to