- wxASSERT(idx < m_size);
- delete m_objects[idx];
- if (idx < m_size - 1)
- memcpy(
- m_objects + idx,
- m_objects + idx + 1,
- ( m_size - idx - 1 ) * sizeof(value_type*) );
- m_size--;
- }
-
- void RemoveAt(size_type idx, size_type count)
- {
- if (count == 0)
- return;
- wxASSERT(idx < m_size);
- size_type i;
- for (i = 0; i < count; i++)
- delete m_objects[idx+1];
- if (idx < m_size - count)
- memcpy(
- m_objects + idx,
- m_objects + idx + count,
- ( m_size - idx - count ) * sizeof(value_type*) );
+ if ( first == last )
+ return first;
+ wxASSERT( first < end() && last <= end() );
+
+ size_type index = first - begin();
+ size_type count = last - first;
+
+ // move the remaining values over to the freed space:
+ for ( iterator i = last; i < end(); ++i )
+ *(i - count) = *i;
+
+ // erase items behind the new end of m_values:
+ for ( iterator i = end() - count; i < end(); ++i )
+ *i = value_type();
+