diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-07-24 23:26:02 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-07-25 14:13:45 +0200 |
commit | 9532d9bc22b411f20d8203b9495aea2eae158e72 (patch) | |
tree | da0fce8e75f4385ed000d45d8b29c56a773bf8e6 /o3tl | |
parent | 29ee386e41971a64874c508dbb09c76438b2d841 (diff) |
sorted_vector: add erase(const_iterator) methods
Change-Id: I4709cfed8f4c5e61d18906dad2948f418409dc0c
Diffstat (limited to 'o3tl')
-rw-r--r-- | o3tl/inc/o3tl/sorted_vector.hxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/o3tl/inc/o3tl/sorted_vector.hxx b/o3tl/inc/o3tl/sorted_vector.hxx index b3ffc4ff8d41..bf1cca5eb937 100644 --- a/o3tl/inc/o3tl/sorted_vector.hxx +++ b/o3tl/inc/o3tl/sorted_vector.hxx @@ -67,6 +67,18 @@ public: base_t::erase( begin_nonconst() + index ); } + // hack: public erase with const_iterator, should not change sort order + void erase(const_iterator const& position) + { + base_t::erase(begin_nonconst() + (position - begin())); + } + + void erase(const_iterator const& first, const_iterator const& last) + { + base_t::erase(begin_nonconst() + (first - begin()), + begin_nonconst() + (last - begin())); + } + // ACCESSORS // Only return a const iterator, so that the vector cannot be directly updated. |