Boost logo

Boost Users :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-11-01 14:45:53


> 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<U,T> map = ...;
ptr_vector<T> vec( map.begin(), map.end() );

-Thorsten


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net