diff options
author | Filippos Karapetis | 2008-04-14 10:07:15 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-04-14 10:07:15 +0000 |
commit | c2e3572fe4a624d5a8fff733bf4db5d1c5fa6849 (patch) | |
tree | 8a45d52d807044540c098c7b0d0e52f402f31598 /common/list.h | |
parent | 8cc1539315d25c99484950b4059004c52e4182cf (diff) | |
download | scummvm-rg350-c2e3572fe4a624d5a8fff733bf4db5d1c5fa6849.tar.gz scummvm-rg350-c2e3572fe4a624d5a8fff733bf4db5d1c5fa6849.tar.bz2 scummvm-rg350-c2e3572fe4a624d5a8fff733bf4db5d1c5fa6849.zip |
Added contains() method to Common::List, same as in Common::Array
svn-id: r31499
Diffstat (limited to 'common/list.h')
-rw-r--r-- | common/list.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/list.h b/common/list.h index 2fe07a5ccc..7c514fd6f4 100644 --- a/common/list.h +++ b/common/list.h @@ -26,6 +26,7 @@ #define COMMON_LIST_H #include "common/scummsys.h" +#include "common/algorithm.h" namespace Common { @@ -267,6 +268,10 @@ public: const_iterator end() const { return const_iterator(const_cast<NodeBase*>(&_anchor)); } + + bool contains(const t_T &key) const { + return find(begin(), end(), key) != end(); + } }; } // End of namespace Common |