diff options
Diffstat (limited to 'src/utils/stl_util.h')
-rw-r--r-- | src/utils/stl_util.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/stl_util.h b/src/utils/stl_util.h index 0e0617d5b..9ae5c5f7a 100644 --- a/src/utils/stl_util.h +++ b/src/utils/stl_util.h @@ -84,6 +84,19 @@ void multimap_insert(std::multimap<K, V>& multimap, #endif } +/** +* Existence check for values +*/ +template<typename T> +bool value_exists(const std::vector<T>& vec, + const T& val) + { + for(size_t i = 0; i != vec.size(); ++i) + if(vec[i] == val) + return true; + return false; + } + } #endif |