summaryrefslogtreecommitdiff
path: root/o3tl
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-07-12 14:03:27 +0200
committerMichael Stahl <mstahl@redhat.com>2012-07-12 14:12:33 +0200
commit96f07eeffc8fc526df9b75a12a33ee7d41a9a099 (patch)
treec34b68980b20ef2d0fa641d31e383d0d55376b18 /o3tl
parent81181891c93faee024799991317ac2c451f4c0c4 (diff)
sorted_vector should not inherit public std::vector
Clearly we don't want to expose std::vector<Value>::insert here, and neither e.g. push_back. Change-Id: I89917a23d6d9f36f56474cdc361ba4d513516122
Diffstat (limited to 'o3tl')
-rw-r--r--o3tl/inc/o3tl/sorted_vector.hxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/o3tl/inc/o3tl/sorted_vector.hxx b/o3tl/inc/o3tl/sorted_vector.hxx
index 79ede037fdd8..c2eebab2f216 100644
--- a/o3tl/inc/o3tl/sorted_vector.hxx
+++ b/o3tl/inc/o3tl/sorted_vector.hxx
@@ -34,7 +34,9 @@ public:
@tpl Compare comparison method
*/
template <class Value, class Compare = std::less<Value> >
-class sorted_vector : public std::vector<Value>, private sorted_vector_compare<Value, Compare>
+class sorted_vector
+ : private std::vector<Value>
+ , private sorted_vector_compare<Value, Compare>
{
public:
typedef typename std::vector<Value>::iterator iterator;
@@ -45,8 +47,10 @@ public:
using std::vector<Value>::begin;
using std::vector<Value>::end;
using std::vector<Value>::clear;
- using std::vector<Value>::insert;
using std::vector<Value>::erase;
+ using std::vector<Value>::empty;
+ using std::vector<Value>::size;
+ using std::vector<Value>::operator[];
// MODIFIERS
@@ -56,7 +60,7 @@ public:
iterator it = std::lower_bound( begin(), end(), x, me );
if( it == end() || less_than(x, *it) )
{
- it = insert( it, x );
+ it = std::vector<Value>::insert( it, x );
return std::make_pair( it, true );
}
return std::make_pair( it, false );