summaryrefslogtreecommitdiff
path: root/o3tl
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-07-17 13:24:10 +0200
committerMichael Stahl <mstahl@redhat.com>2012-07-17 15:28:10 +0200
commit3b199abf89db17420c0ef4df16bdd61ae335f348 (patch)
treee6df38ef76ca932ded6066952b1a4dfba4e64020 /o3tl
parenta24f1f69d1c11ac111bd6dbeb5adbb8a77ffde52 (diff)
sorted_vector: rename nonconst methods to be more obvious
Change-Id: I4ba4164343f252ac451433ba3b07e2cd214e13f8
Diffstat (limited to 'o3tl')
-rw-r--r--o3tl/inc/o3tl/sorted_vector.hxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/o3tl/inc/o3tl/sorted_vector.hxx b/o3tl/inc/o3tl/sorted_vector.hxx
index 7c0d39ebc131..b6f0d3ac6e8a 100644
--- a/o3tl/inc/o3tl/sorted_vector.hxx
+++ b/o3tl/inc/o3tl/sorted_vector.hxx
@@ -55,7 +55,7 @@ public:
std::pair<const_iterator,bool> insert( const Value& x )
{
- iterator it = _lower_bound( x );
+ iterator it = lower_bound_nonconst( x );
if (it == base_t::end() || less_than(x, *it))
{
it = base_t::insert( it, x );
@@ -66,7 +66,7 @@ public:
size_type erase( const Value& x )
{
- iterator it = _lower_bound( x );
+ iterator it = lower_bound_nonconst( x );
if (it != base_t::end() && !less_than(x, *it))
{
erase( it );
@@ -77,7 +77,7 @@ public:
void erase( size_t index )
{
- base_t::erase( _begin() + index );
+ base_t::erase( begin_nonconst() + index );
}
// ACCESSORS
@@ -160,7 +160,8 @@ public:
// of another sorted vector
if ( empty() )
{
- base_t::insert( _begin(), rOther._begin(), rOther._end() );
+ base_t::insert( begin_nonconst(),
+ rOther.begin_nonconst(), rOther.end_nonconst() );
}
else
for( const_iterator it = rOther.begin(); it != rOther.end(); ++it )
@@ -183,14 +184,14 @@ private:
return me.operator()(lhs, rhs);
}
- iterator _lower_bound( const Value& x )
+ iterator lower_bound_nonconst( const Value& x )
{
const MyCompare& me = *this;
return std::lower_bound( base_t::begin(), base_t::end(), x, me );
}
- typename base_t::iterator _begin() { return base_t::begin(); }
- typename base_t::iterator _end() { return base_t::end(); }
+ typename base_t::iterator begin_nonconst() { return base_t::begin(); }
+ typename base_t::iterator end_nonconst() { return base_t::end(); }
};