Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2006-02-21 16:43:10


Felipe Magno de Almeida wrote:

> On 2/20/06, Bill Buklis <boostuser_at_[hidden]> wrote:
>
> [snip]
>
>
>> The only point of #1 is so that the iterators behave exactly like std::map
>> iterators, right? One the one hand, that would be nice for consistency with
>> std::map, but then this is a different class with slightly different uses,
>> so I personally don't mind if it has slightly different characteristics. And
>> the usefulness of operator-> as T* outweighs the need for identical
>> behavior, IMO.
>
>
>
> I had some issues with using std::ptr_map in generic algorithms because of
this.
> I think that the inner typedef's of std::ptr_map, wrt iterator concept
> modelling, must be carefully choosed too. That can break a lot of
> generic code to not work on ptr_map or other ptr_containers.

So you want to ensure that

map::value_type v = *iter;
map::reference r = *iter;
map::pointer p = &*iter;

works and return something with first and second members?

This is almost in place ... I still need to change the internals of
map iterators to precompute the tuple of references ... right now I compute
them on demand.

I suspect this will make iteration somewhat slower.

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk