|
Boost : |
Subject: Re: [boost] [tokenmap] updated perfect hash container in sandbox
From: strasser_at_[hidden]
Date: 2010-04-23 10:12:39
Zitat von Slawomir Lisznianski <sl_at_[hidden]>:
> strasser_at_[hidden] wrote:
>> why is the mapped_type stored by pointer to allocated object
>> instead of by value?
>
> next release (in the works) renames tokenmap to ptr_tokenmap, and a
> new tokenmap comes in its place with by-value semantics.
>
>> I think the "randomized part" could be provided by the user, if the
>> key is a std::pair<index_part, user_part>.
>
> Correct. Next release delegate to an external randomizer. Presumably
> users will plug Boost Random Number.
I think the this could be a container adapter instead of part of the
container, just like std::priority_queue is to std::vector.
adapter::key_type would be std::pair<container::key_type,randomized_part>
you could use the adapter for any container, and easily use tokenmap
without the randomized key part, without using something like
boost::empty as the randomized part (e.g. for thread_specific_ptr).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk