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,
container.push_back(element);
}
template <typename Container, typename ValueType>
inline bool contains(Container const& container, ValueType const& element)
template <typename Container>
bool contains(Container const& container,
typename Container::value_type const& element)
{
return (std::find(container.begin(), container.end(), element) !=
container.end());
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