On Saturday, 2 August 2014 at 15:46:31 UTC, Xinok wrote:
On Saturday, 2 August 2014 at 14:49:49 UTC, bearophile wrote:
Xinok:

I do wonder if we should generalize an interface for these types of ranges.

First of all you need some use cases and usage examples.

Bye,
bearophile

The most obvious use case is generic functions that can operate on associative ranges of any type, regardless of implementation. There are various ways to implement and optimize hash tables for specific use cases, so it would be convenient not to be restricted to a single container.


+1, I'd like to add that compiler is a good example of were this is useful. You'll have quick/small/throwaway and only growing map - to keep track of unwinding infos, break/continue/labels status, switch processing -, long lived one that only grow (and can grow big) - template instance cache, symbol table - as well as map where element goes in and out all the time - for internal machinery -.

Optimal algorithms for these use case are different, and it'd be great if part of the code could be factorized.

For info, SDC only uses out of the box hashmaps for now, but could benefit from better implementations - and doing so is waaaayyyyyy down the priority queue.

Reply via email to