Is there a chance to use a custom std::pmr::polymorphic_allocator to make std::unordered_map’s buckets implemented as arrays?

44 Views Asked by At

While liked-list buckets implementation in std::unordered_map works well when one needs to add/remove elements from the container, it still could be speed up significantly if “stable” or “read-only” version utilizes arrays for buckets. This could help in cases the std::unordered_map filled one time and then used only for lookups.

Can std::pmr::polymorphic_allocator help in changing the used strategy from linked list to array? If so, could you, please, give a clue how this could be done?

If not, what is the best way to achieve the goal above without implementing such a container from scratch?

0

There are 0 best solutions below