c ++ – reflective hash table based on usage

I want to write a hash table that maintains usage statistics and, depending on how it is used, different implementations will be used at runtime. For example, use a particular implementation for small-sized hash tables and a different one for large tables (or parameter settings to maximize cache hits).

How do I do this in C ++?

I am open to using experimental implementations of reflection, since this is an educational project for me and not a production code.