## 24.4.4 Removal and Replacement Algorithms - `unique`

- `unique` much like `list::unique`
- Removes successive values from adjacent, equal elements
- 5 1 3 3 3 2 2 5 4 4 becomes 5 1 3 2 5 4
- Sequence need not be sorted
- Unlike `list::unique`, container not resized

  > `list<int>::iterator p =
  > unique(a.begin(), a.end());
  > a.erase(p, a.end());
  > // Remove the remaining values`

- `unique_copy` analogous; copies resultant sequence to different container

prev |top |next