
22 Feb
2010
22 Feb
'10
2:22 a.m.
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.