C4 Engine
C4 Engine API Documentation

Map::GetLastMapElement

Defined in:  TSMap.h
Returns the last element in a map.
Prototype

type *GetLastMapElement(voidconst;

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

Map::GetFirstMapElement