@code
T *item = array[n];
+ array.Remove(item);
delete item;
- array.Remove(n);
@endcode
See also WX_CLEAR_ARRAY() macro which deletes all elements of a wxArray
(supposed to contain pointers).
+
+ Notice that for sorted arrays this method uses binary search to find
+ the item so it doesn't necessarily remove the first matching item, but
+ the first one found by the binary search.
+
+ @see RemoveAt()
*/
- Remove(T item);
+ void Remove(T item);
/**
Removes @a count elements starting at @a index from the array. When an
See also WX_CLEAR_ARRAY() macro which deletes all elements of a wxArray
(supposed to contain pointers).
*/
- RemoveAt(size_t index, size_t count = 1);
+ void RemoveAt(size_t index, size_t count = 1);
//@}
another, identical, element is in the array.
*/
int Index(T& item, bool searchFromEnd = false) const;
+
/**
This version of Index() is for wxSortedArray only.
- Searches the element in the array, starting from either beginning or
- the end depending on the value of @a searchFromEnd parameter.
+ Searches for the element in the array, using binary search.
+
@c wxNOT_FOUND is returned if the element is not found, otherwise the
index of the element is returned.
*/
- const int Index(T& item) const;
+ int Index(T& item) const;
/**
Search for a place to insert @a item into the sorted array (binary