From 8f5b707d905f84f0102d1fdf365761ca03688742 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 25 Jul 2012 22:55:09 +0200 Subject: sorted_vector: removing the vector::ersase makes more sense Change-Id: Id70e87ab1b7f6a55ad2374cab05fa7f3bdef2cc4 --- o3tl/inc/o3tl/sorted_vector.hxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'o3tl/inc') diff --git a/o3tl/inc/o3tl/sorted_vector.hxx b/o3tl/inc/o3tl/sorted_vector.hxx index 48ad0bcbabb6..0fe46cf7bd02 100644 --- a/o3tl/inc/o3tl/sorted_vector.hxx +++ b/o3tl/inc/o3tl/sorted_vector.hxx @@ -34,7 +34,6 @@ public: typedef typename std::vector::size_type size_type; using base_t::clear; - using base_t::erase; using base_t::empty; using base_t::size; @@ -56,7 +55,7 @@ public: iterator it = lower_bound_nonconst( x ); if (it != base_t::end() && !less_than(x, *it)) { - erase( it ); + base_t::erase(it); return 1; } return 0; @@ -67,7 +66,12 @@ public: base_t::erase( begin_nonconst() + index ); } - // hack: public erase with const_iterator, should not change sort order + // like C++ 2011: erase with const_iterator (doesn't change sort order) + void erase(const_iterator const& position) + { // C++98 has vector::erase(iterator), so call that + base_t::erase(begin_nonconst() + (position - begin())); + } + void erase(const_iterator const& first, const_iterator const& last) { base_t::erase(begin_nonconst() + (first - begin()), -- cgit