Skip to content
Snippets Groups Projects
Commit 7db97fa2 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[BL] Use Container::value_type in contains().

Also drop the unnecessary 'inline', because of a template function.
parent 5207e0f1
No related branches found
No related tags found
No related merge requests found
...@@ -217,11 +217,12 @@ void uniquePushBack(Container& container, ...@@ -217,11 +217,12 @@ void uniquePushBack(Container& container,
container.push_back(element); container.push_back(element);
} }
template <typename Container, typename ValueType> template <typename Container>
inline bool contains(Container const& container, ValueType const& element) bool contains(Container const& container,
typename Container::value_type const& element)
{ {
return (std::find(container.begin(), container.end(), element) != return std::find(container.begin(), container.end(), element) !=
container.end()); container.end();
} }
} // namespace BaseLib } // 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