Map::GetLastMapElement
Defined in:
Returns the last element in a map.
TSMap.h
Prototype
type *GetLastMapElement(void) const;
Description
The GetLastMapElement
function returns a pointer to the last element in a map. If the map is empty, then this function returns nullptr
.The last element in a map is always the one having the greatest key value based on the ordering defined for the
KeyType
type. The MapElement::GetPreviousMapElement
function can be repeatedly called to iterate through the members of a map in reverse order.NOTE. The running time for the
Last
function is O(log n), where n is the number of objects stored in the map.
See Also