|
Boost : |
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2006-02-21 16:47:19
Sam Partington <sam.partington <at> gmail.com> writes:
> I think the important thing here is to provide a consistent behaviour.
> ptr_map is an extension to std::map, and so should behave like
> std::map.
>
> As Felipe says, any deviations from the interface of std::map will
> make it harder to write generic code, and should be avoided where
> possible.
>
> I think it would be surprising to users if the following two
> operations returned different types :
>
> (*i).second
> i->second
I tend to agree. The current implementation of the iterators
kinda sucks...it woeks, but I suspect it to be fairly slow.
I tend to think that I should simply
use std::map<key,T*> instead of std::map<key,void*> underneith
and thus don't change the iterators at all.
This of course exposes the pointers moer than we would like.
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk