[litwindow-users] <map> as container
Status: Alpha
Brought to you by:
hajokirchhoff
From: yrs90 <yr...@ya...> - 2005-04-25 07:30:54
|
I have been pondering <map> containers again. The reason that <map> could not be used as a container was that it didn't have a way to be bookmarked like a vector, is that right? I'm not sure I understand the limitation. It seems that there are at least two possible ways of dealing with bookmarks using a <map>. If the bookmarks are refreshed when a NotifyChanged() is received, the existing implementation of indexing off the begin() iterator looks sufficient. As it stands now, when a new data element is inserted or deleted, the entire view is repopulated, so the index can be refreshed with the updated ordering. If the bookmark needs to persist in the face of insertions and deletions, the iterator itself could be used as the bookmark. <map> has the nice feature of not invalidating the iterators when an element is inserted or deleted (other than the deleted element). This is less volatile than a <vector>. Am I overlooking something? Best regards, Joel --- [This E-mail scanned for viruses by Declude Virus] |