From 1982ac6d6bb3e42db63729355fdd88e2b474e7e2 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Tue, 30 Jul 2019 13:36:37 +0200 Subject: [PATCH] clover/functional: add id_equals helper v2: pass argument by value Signed-off-by: Karol Herbst Reviewed-by: Francisco Jerez Reviewed-by: Pierre Moreau --- .../state_trackers/clover/util/functional.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/gallium/state_trackers/clover/util/functional.hpp b/src/gallium/state_trackers/clover/util/functional.hpp index 98bbdff4bd1..fc281c5c79a 100644 --- a/src/gallium/state_trackers/clover/util/functional.hpp +++ b/src/gallium/state_trackers/clover/util/functional.hpp @@ -347,6 +347,21 @@ namespace clover { const std::string &name; }; + class id_equals { + public: + id_equals(const uint32_t id) : id(id) { + } + + template + bool + operator()(const T &x) const { + return x.id == id; + } + + private: + const uint32_t id; + }; + template class key_equals_t { public: -- 2.30.2