mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-07 14:10:37 +01:00
clover/functional: add id_equals helper
v2: pass argument by value Signed-off-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net> Reviewed-by: Pierre Moreau <pierre.morrow@free.fr>
This commit is contained in:
parent
f3ba98cb18
commit
1982ac6d6b
1 changed files with 15 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue