diff --git a/BaseLib/Algorithm.h b/BaseLib/Algorithm.h index 4a54577b6bb881cf11f757a6ef5a1aa7c5f66b29..57baff5af97a2e51409ceaaf66bf6d7abe9e26db 100644 --- a/BaseLib/Algorithm.h +++ b/BaseLib/Algorithm.h @@ -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