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 6e85839a5..c681ef8c9 100644 --- a/src/utils/stl_util.h +++ b/src/utils/stl_util.h @@ -55,6 +55,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 |