1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-23 23:34:12 +03:00

utils: add contains function

This commit is contained in:
Maxime Coste 2011-10-17 21:05:22 +00:00
parent 316e84f119
commit 1c6eef08f1

View File

@ -5,6 +5,7 @@
#include "assert.hh"
#include <memory>
#include <algorithm>
namespace Kakoune
{
@ -99,6 +100,13 @@ private:
template<typename T>
T* Singleton<T>::ms_instance = nullptr;
template<typename Container, typename T>
bool contains(const Container& container, const T& value)
{
return std::find(container.begin(), container.end(), value)
!= container.end();
}
}
#endif // utils_hh_INCLUDED