We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e47fb8b commit 6f207a4Copy full SHA for 6f207a4
core/templates/list.h
@@ -415,6 +415,19 @@ class List {
415
/**
416
* find an element in the list,
417
*/
418
+ template <typename T_v>
419
+ const Element *find(const T_v &p_val) const {
420
+ const Element *it = front();
421
+ while (it) {
422
+ if (it->value == p_val) {
423
+ return it;
424
+ }
425
+ it = it->next();
426
427
+
428
+ return nullptr;
429
430
431
template <typename T_v>
432
Element *find(const T_v &p_val) {
433
Element *it = front();
0 commit comments