Commit 1982ac6d authored by Karol Herbst's avatar Karol Herbst 🐧 Committed by Karol Herbst

clover/functional: add id_equals helper

v2: pass argument by value
Signed-off-by: Karol Herbst's avatarKarol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez's avatarFrancisco Jerez <currojerez@riseup.net>
Reviewed-by: Pierre Moreau's avatarPierre Moreau <pierre.morrow@free.fr>
parent f3ba98cb
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment