add insert_unverified

This commit is contained in:
David Rose 2007-02-15 21:00:42 +00:00
parent 9f198514ce
commit 9ed9038098
2 changed files with 19 additions and 1 deletions

View File

@ -337,7 +337,7 @@ insert_unique(const TYPENAME ordered_vector<Key, Compare>::VALUE_TYPE &key) {
// the appropriate place. If there are already elements
// sorting equivalent to the key in the vector, the new
// value is inserted following them.
//
// The return value is the iterator referencing the new
// element.
////////////////////////////////////////////////////////////////////
@ -353,6 +353,23 @@ insert_nonunique(const TYPENAME ordered_vector<Key, Compare>::VALUE_TYPE &key) {
}
////////////////////////////////////////////////////////////////////
// Function: ordered_vector::insert_unverified
// Access: Public
// Description: Inserts the indicated key into the ordered vector at
// the indicated place. The user is trusted to have
// already verified that this is the correct sorting
// position; no checks are made.
////////////////////////////////////////////////////////////////////
template<class Key, class Compare>
INLINE TYPENAME ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>::
insert_unverified(TYPENAME ordered_vector<Key, Compare>::ITERATOR position,
const TYPENAME ordered_vector<Key, Compare>::VALUE_TYPE &key) {
TAU_PROFILE("ordered_vector::insert_unverified(iterator, const value_type &)", " ", TAU_USER);
ITERATOR result = _vector.insert(position, key);
return result;
}
////////////////////////////////////////////////////////////////////
// Function: ordered_vector::erase, with iterator
// Access: Public

View File

@ -192,6 +192,7 @@ public:
ITERATOR insert_nonunique(ITERATOR position, const VALUE_TYPE &key);
INLINE pair<ITERATOR, bool> insert_unique(const VALUE_TYPE &key);
INLINE ITERATOR insert_nonunique(const VALUE_TYPE &key);
INLINE ITERATOR insert_unverified(ITERATOR position, const VALUE_TYPE &key);
// Erase operations.
INLINE ITERATOR erase(ITERATOR position);