Boost logo

Boost :

From: niko_pro_at_[hidden]
Date: 1999-10-07 23:05:44


hi valentin bonnard <bonnard.-_at_[hidden]> and Lois Goldthwaite thanks
for your reply.

We could acomplish the structure with a second multimap (not map) as
follows:
 
typedef map<key_type, value_type> regular_map;
typedef multimap<value_type, regular_map::iterator> reverse_map;

The reason for this is that values (of type value_type) in the
regular_map are not unique, and thus can not be used as key in the
reverse_map (if reverse_map is a map).

The problem is that insertions/iterations/search are slow.

Is there any way in which i can make regular_map have key_type as its
key and iterator to reverse_map as its value_type, and reverse_map has
value_type as its key and iterator to regular_map as its value type.
Something like :

typedef map<key_type, XXXX /*itarator of reverse_map*/> regular_map;
typedef multimap<value_type, regular_map::iterator> reverse_map;

'On the face of it' it looks easy but the declaration is 'recursive'.

The situation i face is far more demanding. This type of associative
container has to be templete base and should be useable/reusable as
other STL containers and should provide same interface as STL
containers.
The regular_map could be a map or multimap and iterations/insertions/de
letions have to be very fast.

thanks
niko.


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