Module: Mesa
Branch: master
Commit: 1982ac6d6bb3e42db63729355fdd88e2b474e7e2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1982ac6d6bb3e42db63729355fdd88e2b474e7e2

Author: Karol Herbst <[email protected]>
Date:   Tue Jul 30 13:36:37 2019 +0200

clover/functional: add id_equals helper

v2: pass argument by value

Signed-off-by: Karol Herbst <[email protected]>
Reviewed-by: Francisco Jerez <[email protected]>
Reviewed-by: Pierre Moreau <[email protected]>

---

 src/gallium/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<typename T>
+      bool
+      operator()(const T &x) const {
+         return x.id == id;
+      }
+
+   private:
+      const uint32_t id;
+   };
+
    template<typename T>
    class key_equals_t {
    public:

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to