I am trying to use tbb::parallel_sort
to sort 2 arrays at the same time. Intel\'s documentation here says https://software.intel.com/en-us/node/506167 The req
For a RandomAccessIterator, reference
must be a reference to value_type
. It cannot be a tuple of references.
As such, your dual iterator is not a valid RandomAccessIterator.
Many algorithms will still work, but that doesn't make your code valid.
The requirements being the same does not mean that anything that works with a given implementation of std::sort
will also work with tbb::parallel_sort
: a given implementation of std::sort
does not have to enforce all of the requirements made in the standard.
Regardless of the documentation, if the implementation won't work with your code, it won't work with your code.
The easiest approach might be to create an array of pseudo-pairs of indexes (or iterators) into the original arrays, then sort it. You just need to override <
properly.