diff --git a/src/utils.hh b/src/utils.hh index fcc7a77a..6bfdb907 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -5,6 +5,7 @@ #include "assert.hh" #include +#include namespace Kakoune { @@ -99,6 +100,13 @@ private: template T* Singleton::ms_instance = nullptr; +template +bool contains(const Container& container, const T& value) +{ + return std::find(container.begin(), container.end(), value) + != container.end(); +} + } #endif // utils_hh_INCLUDED