Boost logo

Boost :

From: Reggie Seagraves (reggie313_at_[hidden])
Date: 2001-03-05 21:01:36


Hi Howard!

     Let's say you're implementing an interpreter with containers which
roughly correspond to STL containers (like i am)...and you want to
provide a consistent interface in your containers. During your first
rev., you might use std::map for a namespace-like container (say dictionary).
After it's working, with iterators just like all your other containers,
with, for the sake of argument, operators like "next" and "prev" for
modifying iterator positions, you decide that for performance reasons
you'd rather be using a hash_map. At that point you'd like to just
drop in a hash_map container that has the same interface, semantics
(including iterator semantics), etc. as a std::map. (Just like me)
    I had to add bidirectional iterators to a previous implementation
of hash_map, and have been maintaining it ever since. I would REALLY
prefer not to continue to maintain it as I rev my environment of choice
(that's right, Codewarrior!) ;)
    I hope that this shows supporting identical features as std::map
is extremely important in a hash_map implementation.

        Thanks,

            Reggie

>Mark Rodgers wrote on 3/5/01 2:43 AM
>>Another problem with the SGI version is that they only support
>>forward iterators, and thus don't conform to the associative
>>container requirements (23.1.2 para 6). It would be nicer if
>>any hash container were to be a conformant associative container
>>and support bi-directional iterators, at least as an option.
>
>I have trouble understanding the value of iterating through an unordered
>sequence in reverse order. Could you give examples of when this
>functionality would be useful with a hash container?
>
>-Howard
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


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