1 Nov
2005
1 Nov
'05
7:45 p.m.
Right, I see. Well, xxx.key() makes sense, but IMHO overloading operator*() to return the "value" is quite confusing. To me, it would make more sense to provide explicit accessors such as: iterator.key iterator.value
Or something similar. Whether these are function calls or not, IMHO, doesn't matter, but the readability would be a lot higher.
I'll think about adding i.value() too. The reason that it is good to have operator*() return something is that we don't need another layer around algorithms to accomdate for the different syntax...so I can clone the values and put them in a ptr_vector quite easily: ptr_map map = ...; ptr_vector<T> vec( map.begin(), map.end() ); -Thorsten