Wednesday, December 2, 2009

unique() and unique_copy()

The STL algorithms, unique() and unique_copy() do not require their input to be sorted. The result might be surprising though, since only duplicates that are adjacent are removed.
Reference: Effective STL by Scott Meyers, Addison-Wesley, 2001., p. 147.

No comments:

Post a Comment