From 2342e7686fb9de142b0f331852bb5294c55c6440 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 6 May 2013 13:51:23 +0200 Subject: [PATCH] add specialized contains function for unordered_set --- src/utils.hh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/utils.hh b/src/utils.hh index e7315cc2..73950562 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -7,6 +7,7 @@ #include #include #include +#include namespace Kakoune { @@ -182,6 +183,12 @@ bool contains(Container&& container, const T& value) return (not container.empty()) and find(container, value) != container.end(); } +template +bool contains(const std::unordered_set& container, const T2& value) +{ + return container.find(value) != container.end(); +} + // *** On scope end *** // // on_scope_end provides a way to register some code to be