Skip to content
Snippets Groups Projects
Commit 4675690b authored by Norihiro Watanabe's avatar Norihiro Watanabe Committed by Dmitri Naumov
Browse files

[Base] add contains() to Algorithm

parent d2443b10
No related branches found
No related tags found
No related merge requests found
......@@ -216,4 +216,12 @@ void uniquePushBack(Container& container,
container.end())
container.push_back(element);
}
template <typename Container, typename ValueType>
inline bool contains(Container const& container, ValueType const& element)
{
return (std::find(container.begin(), container.end(), element) !=
container.end());
}
} // namespace BaseLib
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment