ArgSort and generalized ArgMax/ArgMin

Describe the feature you would like to be implemented.

Those argSort, argMin/Max implementation work but it's not a meta-template since I'm having quite some trouble doing that in C++14 due to the compile-time sizes. Also I'm not sure how one would go about the 2D case. Those are essentially convenience functions, but ArgMax/Min dispatch to the most efficient sorting algorithm for each specific case, which is handy.

Would such a feature be useful for other users? Why?

ArgSort: Allows to sort a single container then store that sorting map. It can then either be used to retrieve the sorting state of that array or apply the same sorting to other arrays (indexation is much faster than re-sorting those arrays).

Generalized ArgMin/Max: Return the index of the k largest/smallest values of a container.

Any hints on how to implement the requested feature?

Note that this implementation isn't meta-templated, since I wanted to gauge the interest before spending time meta-templating it. https://godbolt.org/z/n1G495nnr

Edited by Stéphane T.