Boost logo

Boost :

Subject: Re: [boost] [Tokenmap] A (perfect) hash container library chcked-in to sandbox (RFC)
From: joaquin_at_[hidden]
Date: 2010-02-22 10:59:53


OvermindDL1 escribió:
> On Sun, Feb 21, 2010 at 4:44 PM, Andrey Semashev
> <andrey.semashev_at_[hidden]> wrote:
>
>> On 21.02.2010 23:59, Slawomir Lisznianski wrote:
>>
>>> http://svn.boost.org/svn/boost/sandbox/tokenmap/libs/tokenmap/doc/html/index.html
>>>
>>> [...]
>>>
>>> Specifically, when a new element is
>>> inserted into the tokenmap, an apparently random key is returned back
>>> to the caller which uniquely maps to the stored element. The returned
>>> key can later be used in a very efficient lookup.
>>>
>>> [...]
>>>
>> How is it different from having an iterator or a pointer to the inserted
>> element?
>>
>
> Because those can get invalidated if the map resizes I would wager...
>
>

Given the very limited interface of tokenmap, you can easily implement
in on top of
a std::list, whose iterators do not get invalidated. I think Andrey's
question is a critical one
and has not yet been addressed.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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