diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-07-25 22:55:09 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-07-25 22:56:12 +0200 |
commit | 8f5b707d905f84f0102d1fdf365761ca03688742 (patch) | |
tree | 9a79adbac7a2e09ce53bf50862b5dfd2b91077eb /o3tl | |
parent | 07c1dac0d8844b48290bac4b55c055cc897e61af (diff) |
sorted_vector: removing the vector::ersase makes more sense
Change-Id: Id70e87ab1b7f6a55ad2374cab05fa7f3bdef2cc4
Diffstat (limited to 'o3tl')
-rw-r--r-- | o3tl/inc/o3tl/sorted_vector.hxx | 10 |
1 files changed, 7 insertions, 3 deletions
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<Value>::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()), |