This replaces the
index_constant logic used previously in the rans and ransnc tests with
This should be much shorter and slightly easier to read, thanks to use of c++17.
This is not high priority as it is only clean up.
This could also be squashed if necessary, I separated the steps for easier reviewing.