Created
July 12, 2014 10:26
-
-
Save OndrejSlamecka/0c304786dd5d4c24fe4d to your computer and use it in GitHub Desktop.
C++ contains (not tested)
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 <template <class> class C, typename T> | |
bool contains(C<T> container, T item) { | |
return std::find(container.begin(), container.end(), item) != container.end(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment