From 96f07eeffc8fc526df9b75a12a33ee7d41a9a099 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 12 Jul 2012 14:03:27 +0200 Subject: sorted_vector should not inherit public std::vector Clearly we don't want to expose std::vector::insert here, and neither e.g. push_back. Change-Id: I89917a23d6d9f36f56474cdc361ba4d513516122 --- 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 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 sorted_vector : public std::vector, private sorted_vector_compare +class sorted_vector + : private std::vector + , private sorted_vector_compare { public: typedef typename std::vector::iterator iterator; @@ -45,8 +47,10 @@ public: using std::vector::begin; using std::vector::end; using std::vector::clear; - using std::vector::insert; using std::vector::erase; + using std::vector::empty; + using std::vector::size; + using std::vector::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::insert( it, x ); return std::make_pair( it, true ); } return std::make_pair( it, false ); -- cgit