Boost logo

Boost :

Subject: Re: [boost] [Tokenmap] A (perfect) hash container library chcked-in to sandbox (RFC)
From: Slawomir Lisznianski (slisznia_at_[hidden])
Date: 2010-02-21 21:22:57


Daniel, your client-server example nailed the purpose of tokenmap quite nicely.

> new element can be inserted, but the `find` and `pop` members do not employ
> a loop when looking up the given key (to account for the possibility that
> they key resulted in a collision when it was inserted).

Once the key is generated, it's "perfect" and collisions in find or
pop are not possible.

> Also, there are some improvements that can be made:  supporting an
> allocator type

OK

> and getting rid of the floating-point arithmetic around where
> you check whether a doubling of the capacity can succeed (lines 175-176; you
> can use the `max_size` member of `std::vector` and halve the result, rather
> than double `store_.capacity()`).

I will look into it. Thanks.


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