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:
parent
316e84f119
commit
1c6eef08f1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user