This is most likely not the best solution but it does the work. Please see the comment how the keys should be organized (sorted and no doubles). The algorithm will erase values starting with the biggest keys. typedef std::vector<float> tFloatVector; tFloatVector aFloatVec; void erase( int nKey ) { if( nKey < aFloatVec.size() ) { tFloatVector::iterator iFloatVec = aFloatVec.begin(); iFloatVec += nKey - 1; if( iFloatVec != aFloatVec.end() ) aFloatVec.erase( iFloatVec ); } } int _tmain(int argc, _TCHAR* argv[]) { typedef std::vector<int> tIntVector; // assuming int's are sorted small to big // and there are no doubles. tIntVector aIntVec; aIntVec.push_back( 1 ); aIntVec.push_back( 3 ); aIntVec.push_back( 4 ); aIntVec.push_back( 5 ); aFloatVec.push_back( 1.0F ); aFloatVec.push_back( 2.0F ); aFloatVec.push_back( 3.0F ); aFloatVec.push_back( 4.0F ); aFloatVec.push_back( 5.0F ); aFloatVec.push_back( 6.0F ); aFloatVec.push_back( 7.0F ); aFloatVec.push_back( 8.0F ); std::reverse( aIntVec.begin(), aIntVec.end() ); std::for_each( aIntVec.begin(), aIntVec.end(), boost::bind( &erase, _1 ) ); } Would be interesting to see how the boost expert would solve the problem. ;-) Christian