
21 Apr
2008
21 Apr
'08
8:24 p.m.
On 21/04/2008, Thorsten Ottosen <thorsten.ottosen@dezide.com> wrote:
Daniel James skrev:
An alternative that has some appeal is letting the user specify a policy class to control the bucket count. Although I'm not sure how that would play with the standard.
Poor, probably.
I guess for cases where I know the intergers fall in the range, say, [0,64], I can just use vector<optional<unsigned>>.
Thinking about it some more, I could create a trait class for the hash function. template <class T> struct is_good_hash : public boost::mpl::false_ {}; template <> struct is_good_hash<groovy_hash> : public boost::mpl::true_ {}; And use power of 2 tables when the trait is true. Daniel