summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-11-27 09:07:51 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-11-27 09:07:51 +0100
commita87eb89017dad9d87719dd1bf6c3e5cbf9ed5759 (patch)
treef0290b0c3141f613f320f082800acb021baac911
parentd9a3adf89754520a355b92fcc95cb17e0286c959 (diff)
Added List::del().
-rw-r--r--common/list.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/list.h b/common/list.h
index 92452f1..d15913d 100644
--- a/common/list.h
+++ b/common/list.h
@@ -19,6 +19,11 @@ class List : public B {
return std::find(B::begin(), B::end(), item) != B::end();
}
+ //! Delete item by index.
+ void del(std::size_t index) {
+ erase(B::begin() + index);
+ }
+
//! Check whether list is empty or not.
operator bool() {
return !B::empty();