mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-22 18:37:01 +00:00
Added contains() method to Common::List, same as in Common::Array
svn-id: r31499
This commit is contained in:
parent
8cc1539315
commit
c2e3572fe4
@ -26,6 +26,7 @@
|
|||||||
#define COMMON_LIST_H
|
#define COMMON_LIST_H
|
||||||
|
|
||||||
#include "common/scummsys.h"
|
#include "common/scummsys.h"
|
||||||
|
#include "common/algorithm.h"
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
|
||||||
@ -267,6 +268,10 @@ public:
|
|||||||
const_iterator end() const {
|
const_iterator end() const {
|
||||||
return const_iterator(const_cast<NodeBase*>(&_anchor));
|
return const_iterator(const_cast<NodeBase*>(&_anchor));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool contains(const t_T &key) const {
|
||||||
|
return find(begin(), end(), key) != end();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of namespace Common
|
} // End of namespace Common
|
||||||
|
Loading…
x
Reference in New Issue
Block a user