I understand that boost buckets internally are implemented as liked lists, right? At least according to http://www.boost.org/doc/libs/1_50_0/doc/html/unordered/buckets.html it seems like it.
My question is, what is the order of elements in these buckets? If they are unordered, is there any way to enforce MRU (most recently used) or some other move-to-front heuristic onto items order in these buckets?
Edit: I understand arguments against enforcing MRU inside buckets. But in my specific case I know, that enforcing MRU [or even having last-in-first-served] would outperform having smaller load factor. Question is, what is the order? Is there a simple way to enforce at least last-inserted-first-out&served.
The buckets are unsorted. There are compelling reasons why the buckets are unsorted. While I’m sure you’re aware of this, I’ll enumerate a couple to help future visitors of the site.
Enforcing MRU ordering of the buckets seems, to my eyes, to be against the whole idea of a hash map-type structure in the first place. The idea is to keep the buckets small so that, on average, the first item in the bucket is the one you’re actually looking for.
Because of this, I doubt there’s any built-in way to enforce MRU ordering within the buckets. I’d recommend tuning your hashing algorithm instead, maybe turning down your max load factor.