Boost logo

Boost :

Subject: Re: [boost] [tokenmap] updated perfect hash container in sandbox
From: strasser_at_[hidden]
Date: 2010-04-21 12:12:51


could you please provide some additional rationale for this container?
I don't understand the advantage to allocating values without any type
of container and using the pointers as keys.

as I understand the tokenmap-container / my assumptions:
- insert()ing into the container requires an allocation
- the key values are unknown to the user of the container
- the key type must (internally) be integral

so what is the advantage to simply allocating the mapped_type and
using the returned pointer as the key?

in container-form:

class container{
   typedef ... mapped_type;
   typedef mapped_type *key_type;
   ...
   key_type insert(mapped_type &v){
     return new mapped_type(v);
   }
}

(to make the container iteratable(if that`s a word) a linked list
would have to be used, but a tokenmap also seems to do that)

what am I missing?


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