On Thu, Jan 24, 2019 at 9:49 AM John Maddock via Boost < boost@lists.boost.org> wrote:
Question: would the interface be better specified with a constexpr initializer-list constructor rather than templating on an array of data? That way you would have complete control of memory layout as well? Or am I misinterpreting things?
I think that if you want best performance you want to template on values since if for example you only template on type, then you can not know some very useful stuff at compile time. We want to pick a constant for universal hashing that works great for our values. Consider example where we are lucky and we get no collisions. If we know that at compile time compiler can remove the loop(probe until some condition) since it knows iteration count is 1. If that value is just some member variable that can be 1 or 2 or 5 depending on data compiler can not remove that loop. In other words I believe that for best performance codegen for different values needs to be different. I am happy to be proven wrong. :)