From 9532d9bc22b411f20d8203b9495aea2eae158e72 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 24 Jul 2012 23:26:02 +0200 Subject: sorted_vector: add erase(const_iterator) methods Change-Id: I4709cfed8f4c5e61d18906dad2948f418409dc0c --- o3tl/inc/o3tl/sorted_vector.hxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'o3tl/inc') 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. -- cgit