diff --git a/core/templates/list.h b/core/templates/list.h index 79a67c7e52e..7804921c479 100644 --- a/core/templates/list.h +++ b/core/templates/list.h @@ -415,6 +415,19 @@ public: /** * find an element in the list, */ + template + const Element *find(const T_v &p_val) const { + const Element *it = front(); + while (it) { + if (it->value == p_val) { + return it; + } + it = it->next(); + } + + return nullptr; + } + template Element *find(const T_v &p_val) { Element *it = front();