Created
October 8, 2013 05:40
-
-
Save swapnil-warke/6879969 to your computer and use it in GitHub Desktop.
Stl hint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T> | |
void remove_duplicates(std::vector<T>& vec) | |
{ | |
std::sort(vec.begin(), vec.end()); | |
vec.erase(std::unique(vec.begin(), vec.end()), vec.end()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment