diff --git a/etk/Map.hpp b/etk/Map.hpp index 978cd00..ac7185c 100644 --- a/etk/Map.hpp +++ b/etk/Map.hpp @@ -536,6 +536,24 @@ namespace etk { } return position(elementId); } + /** + * @brief Count the number of occurence of a specific element. + * @param[in] _key Name of the element to count iterence + * @return 0 No element was found + * @return 1 One element was found + */ + size_t count(const ETK_MAP_TYPE_KEY& _key) const { + // TODO: search in a dichotomic way. + for (size_t iii=0; iiifirst == _key) { + return 1; + } + } + return 0; + } };