I can't barely find anything on the subject over the whole Internet:
What is returned by an OMUIterator over an OMUMap?
Is it the key? Is it the value (element)? Or is it the pair (Item(key, element))?
Everything is void* in a OMUxxx (for a good reason of course!), so it is quite hard to guess...
This topic has been locked.
9 replies Latest Post - 2012-09-26T20:36:52Z by MaitreBart
Pinned topic OMUMap and OMUIterator
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-09-26T20:36:52Z at 2012-09-26T20:36:52Z by MaitreBart
Re: OMUMap and OMUIterator2012-09-18T15:25:20Z in response to shanz9903Interesting example.
However, the problem is that the iterator is used by the queue, not by the map.
Moreover, the example could have used a list instead of a map as far as the visited container is concerned because the use of the map's value (int) is trivial: The user just wants to check for the presence of the key.
Re: OMUMap and OMUIterator2012-09-18T15:08:07Z in response to shanz9903Yes, I did go to this page: Nothing says anything about iterators.
And the add() method is not accessible. In OMMap it is not even documented.
If you take time to inspect all the methods, you'll find most information is trivial (still useful).
The remove methods indicate they "delete" the elements of the map. Isn't that pernicious?
Do the methods really call the 'delete' operator on each element?
What if the user still want to keep a reference on what he most probably called 'new' upon each of them in order to create them?
Or is it more realistic to think that the remove methods simply move the elements out of the map, without deleting them?