Suppose that I have two, for example, float
arrays a
and b
, an int
key array k
and a template mySortByKey
function of my own, operating on a single array, something like
template<class T>
mySortByKey(int *k, T *a)
Is there a possibility (for example, using zip iterators and tuples of some sorts) to enable mySort
operating simultaneously on a
and b
, so that they can be simultaneously ordered according to the key k
?