diff --git a/etk/Map.hpp b/etk/Map.hpp index 025f621..3ec0eda 100644 --- a/etk/Map.hpp +++ b/etk/Map.hpp @@ -542,7 +542,7 @@ namespace etk { return Iterator(this, _pos); } /** - * @brief Get an Iterator on the start position of the Vector + * @brief Get an Iterator on the start position of the Map * @return The Iterator */ Iterator begin() { @@ -552,7 +552,7 @@ namespace etk { return position(0); } /** - * @brief Get an Iterator on the end position of the Vector + * @brief Get an Iterator on the end position of the Map * @return The Iterator */ Iterator end() { @@ -561,6 +561,22 @@ namespace etk { const Iterator end() const { return position(size()); } + /** + * @brief Get the last element in the Map or end() + * @return The Iterator + */ + Iterator back() { + if (size() > 0) { + return position(size()-1); + } + return position(size()); + } + const Iterator back() const { + if (size() > 0) { + return position(size()-1); + } + return position(size()); + } Iterator find(const ETK_MAP_TYPE_KEY& _key) { int64_t elementId = getId(_key);