aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-14 14:44:17 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-14 14:44:17 +0000
commitf8607b57c8ec9d0f2e7798e67efdf1c99c72017b (patch)
tree9b8d371177ccaf3f6cea15aab72dfbe7483c9431
parent7c419689bd792f329cf5e82fac4a11b536b61c00 (diff)
downloadpaludis-f8607b57c8ec9d0f2e7798e67efdf1c99c72017b.tar.gz
paludis-f8607b57c8ec9d0f2e7798e67efdf1c99c72017b.tar.xz
Provide an erase method for SortedCollection
-rw-r--r--paludis/util/collection.hh10
1 files changed, 9 insertions, 1 deletions
diff --git a/paludis/util/collection.hh b/paludis/util/collection.hh
index 720cb7b..aff5056 100644
--- a/paludis/util/collection.hh
+++ b/paludis/util/collection.hh
@@ -209,12 +209,20 @@ namespace paludis
/**
* Insert an item, return whether we succeeded.
*/
- bool insert(T_ v)
+ bool insert(const T_ & v)
{
return _items.insert(v).second;
}
/**
+ * Erase an item, return whether we succeeded.
+ */
+ bool erase(const T_ & v)
+ {
+ return 0 != _items.erase(v);
+ }
+
+ /**
* Insert all items from another container.
*/
bool merge(typename SortedCollection<T_>::ConstPointer o)